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
path: root/source
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-21 01:02:12 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-21 01:02:12 +0400
commit2676f2d58f71f438008b413a86b873e7787d80ea (patch)
treeeb541972cf32d5958b7c0f7f8ece525b78cfcbff /source
parentbb9976f058ba2090812074e1b774213d20821a30 (diff)
parent4ab1dadf72a821b344a714fff59aed11d15ecb14 (diff)
Merged changes in the trunk up to revision 42021.
Conflicts resolved: source/blender/blenkernel/intern/scene.c source/blender/blenloader/intern/readfile.c source/blender/editors/interface/resources.c source/blender/render/intern/source/pipeline.c
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenfont/intern/blf_lang.c4
-rw-r--r--source/blender/blenfont/intern/blf_translation.c2
-rw-r--r--source/blender/blenkernel/BKE_blender.h6
-rw-r--r--source/blender/blenkernel/BKE_camera.h75
-rw-r--r--source/blender/blenkernel/BKE_dynamicpaint.h4
-rw-r--r--source/blender/blenkernel/BKE_idprop.h8
-rw-r--r--source/blender/blenkernel/BKE_image.h2
-rw-r--r--source/blender/blenkernel/BKE_modifier.h3
-rw-r--r--source/blender/blenkernel/BKE_node.h48
-rw-r--r--source/blender/blenkernel/BKE_object.h12
-rw-r--r--source/blender/blenkernel/BKE_ocean.h110
-rw-r--r--source/blender/blenkernel/BKE_scene.h4
-rw-r--r--source/blender/blenkernel/BKE_screen.h1
-rw-r--r--source/blender/blenkernel/BKE_texture.h5
-rw-r--r--source/blender/blenkernel/BKE_tracking.h2
-rw-r--r--source/blender/blenkernel/CMakeLists.txt13
-rw-r--r--source/blender/blenkernel/SConscript7
-rw-r--r--source/blender/blenkernel/intern/BME_Customdata.c2
-rw-r--r--source/blender/blenkernel/intern/BME_mesh.c8
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c8
-rw-r--r--source/blender/blenkernel/intern/camera.c472
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/constraint.c141
-rw-r--r--source/blender/blenkernel/intern/customdata.c2
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c86
-rw-r--r--source/blender/blenkernel/intern/fcurve.c12
-rw-r--r--source/blender/blenkernel/intern/idprop.c82
-rw-r--r--source/blender/blenkernel/intern/image.c4
-rw-r--r--source/blender/blenkernel/intern/implicit.c2
-rw-r--r--source/blender/blenkernel/intern/mball.c12
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c2
-rw-r--r--source/blender/blenkernel/intern/modifier.c38
-rw-r--r--source/blender/blenkernel/intern/nla.c4
-rw-r--r--source/blender/blenkernel/intern/node.c432
-rw-r--r--source/blender/blenkernel/intern/object.c96
-rw-r--r--source/blender/blenkernel/intern/ocean.c1425
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
-rw-r--r--source/blender/blenkernel/intern/scene.c54
-rw-r--r--source/blender/blenkernel/intern/sequencer.c3
-rw-r--r--source/blender/blenkernel/intern/softbody.c2
-rw-r--r--source/blender/blenkernel/intern/text.c47
-rw-r--r--source/blender/blenkernel/intern/texture.c52
-rw-r--r--source/blender/blenkernel/intern/tracking.c156
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c10
-rw-r--r--source/blender/blenlib/BLI_math_geom.h47
-rw-r--r--source/blender/blenlib/BLI_mempool.h43
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c2
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c212
-rw-r--r--source/blender/blenlib/intern/DLRB_tree.c2
-rw-r--r--source/blender/blenlib/intern/bpath.c10
-rw-r--r--source/blender/blenlib/intern/math_geom.c183
-rw-r--r--source/blender/blenlib/intern/math_rotation.c4
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c6
-rw-r--r--source/blender/blenlib/intern/path_util.c6
-rw-r--r--source/blender/blenloader/intern/readfile.c113
-rw-r--r--source/blender/blenloader/intern/writefile.c1
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c11
-rw-r--r--source/blender/editors/animation/anim_markers.c6
-rw-r--r--source/blender/editors/curve/editcurve.c55
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c6
-rw-r--r--source/blender/editors/include/ED_curve.h2
-rw-r--r--source/blender/editors/include/ED_transform.h8
-rw-r--r--source/blender/editors/include/ED_view3d.h9
-rw-r--r--source/blender/editors/include/UI_interface.h4
-rw-r--r--source/blender/editors/include/UI_resources.h3
-rw-r--r--source/blender/editors/interface/interface.c62
-rw-r--r--source/blender/editors/interface/interface_anim.c19
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/interface/interface_icons.c4
-rw-r--r--source/blender/editors/interface/interface_intern.h2
-rw-r--r--source/blender/editors/interface/interface_layout.c39
-rw-r--r--source/blender/editors/interface/interface_ops.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c98
-rw-r--r--source/blender/editors/interface/interface_regions.c25
-rw-r--r--source/blender/editors/interface/interface_style.c1
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c17
-rw-r--r--source/blender/editors/interface/resources.c14
-rw-r--r--source/blender/editors/interface/view2d.c4
-rw-r--r--source/blender/editors/interface/view2d_ops.c4
-rw-r--r--source/blender/editors/object/object_add.c21
-rw-r--r--source/blender/editors/object/object_bake.c45
-rw-r--r--source/blender/editors/object/object_constraint.c2
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_modifier.c220
-rw-r--r--source/blender/editors/object/object_ops.c4
-rw-r--r--source/blender/editors/object/object_vgroup.c2
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c47
-rw-r--r--source/blender/editors/physics/physics_fluid.c39
-rw-r--r--source/blender/editors/render/render_internal.c7
-rw-r--r--source/blender/editors/render/render_opengl.c8
-rw-r--r--source/blender/editors/render/render_shading.c29
-rw-r--r--source/blender/editors/screen/area.c173
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c27
-rw-r--r--source/blender/editors/space_action/action_select.c9
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c2
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c31
-rw-r--r--source/blender/editors/space_clip/clip_ops.c2
-rw-r--r--source/blender/editors/space_clip/clip_toolbar.c2
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c53
-rw-r--r--source/blender/editors/space_file/file_ops.c11
-rw-r--r--source/blender/editors/space_graph/graph_select.c64
-rw-r--r--source/blender/editors/space_info/info_report.c13
-rw-r--r--source/blender/editors/space_info/info_stats.c2
-rw-r--r--source/blender/editors/space_nla/nla_select.c10
-rw-r--r--source/blender/editors/space_node/drawnode.c15
-rw-r--r--source/blender/editors/space_node/node_draw.c49
-rw-r--r--source/blender/editors/space_node/node_edit.c3
-rw-r--r--source/blender/editors/space_node/node_select.c6
-rw-r--r--source/blender/editors/space_node/node_templates.c11
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c47
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c7
-rw-r--r--source/blender/editors/space_text/text_draw.c2
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c32
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c175
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c68
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h4
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c309
-rw-r--r--source/blender/editors/transform/transform.c8
-rw-r--r--source/blender/editors/transform/transform_generics.c26
-rw-r--r--source/blender/editors/transform/transform_manipulator.c91
-rw-r--r--source/blender/editors/transform/transform_snap.c175
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c20
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c4
-rw-r--r--source/blender/gpu/CMakeLists.txt2
-rw-r--r--source/blender/gpu/GPU_material.h2
-rw-r--r--source/blender/gpu/SConscript2
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c27
-rw-r--r--source/blender/gpu/intern/gpu_shader_material.glsl42
-rw-r--r--source/blender/gpu/intern/gpu_shader_material.glsl.c2448
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c24
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp10
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h2
-rw-r--r--source/blender/imbuf/intern/anim_movie.c125
-rw-r--r--source/blender/imbuf/intern/moviecache.c6
-rw-r--r--source/blender/makesdna/DNA_ID.h7
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h11
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h1
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h65
-rw-r--r--source/blender/makesdna/DNA_node_types.h6
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h5
-rw-r--r--source/blender/makesdna/DNA_particle_types.h5
-rw-r--r--source/blender/makesdna/DNA_texture_types.h26
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h12
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h18
-rw-r--r--source/blender/makesdna/intern/makesdna.c10
-rw-r--r--source/blender/makesrna/RNA_access.h3
-rw-r--r--source/blender/makesrna/RNA_define.h3
-rw-r--r--source/blender/makesrna/RNA_types.h13
-rw-r--r--source/blender/makesrna/SConscript3
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/makesrna.c39
-rw-r--r--source/blender/makesrna/intern/rna_access.c54
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c88
-rw-r--r--source/blender/makesrna/intern/rna_armature.c4
-rw-r--r--source/blender/makesrna/intern/rna_camera.c27
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c89
-rw-r--r--source/blender/makesrna/intern/rna_context.c2
-rw-r--r--source/blender/makesrna/intern/rna_controller.c2
-rw-r--r--source/blender/makesrna/intern/rna_define.c12
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c92
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c22
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c17
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c108
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c236
-rw-r--r--source/blender/makesrna/intern/rna_movieclip.c16
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c146
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_pose.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c41
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c13
-rw-r--r--source/blender/makesrna/intern/rna_space.c46
-rw-r--r--source/blender/makesrna/intern/rna_text.c2
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c20
-rw-r--r--source/blender/makesrna/intern/rna_texture.c54
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c107
-rw-r--r--source/blender/makesrna/intern/rna_ui.c37
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c3
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c71
-rw-r--r--source/blender/makesrna/intern/rna_wm.c76
-rw-r--r--source/blender/modifiers/CMakeLists.txt9
-rw-r--r--source/blender/modifiers/MOD_modifiertypes.h1
-rw-r--r--source/blender/modifiers/SConscript3
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c16
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c45
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c565
-rw-r--r--source/blender/modifiers/intern/MOD_util.c1
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c15
-rw-r--r--source/blender/nodes/NOD_composite.h158
-rw-r--r--source/blender/nodes/NOD_shader.h114
-rw-r--r--source/blender/nodes/NOD_socket.h3
-rw-r--r--source/blender/nodes/NOD_texture.h72
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c15
-rw-r--r--source/blender/nodes/composite/node_composite_util.c55
-rw-r--r--source/blender/nodes/composite/node_composite_util.h2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_alphaOver.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_bilateralblur.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_blur.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_brightness.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_channelMatte.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_chromaMatte.c17
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorMatte.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorSpill.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorbalance.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_common.c27
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_composite.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_crop.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_curves.c21
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_defocus.c18
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_diffMatte.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_dilate.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_directionalblur.c11
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_displace.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_distanceMatte.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_filter.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_flip.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_gamma.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_glare.c15
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_hueSatVal.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_huecorrect.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_idMask.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_image.c15
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_invert.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_lensdist.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_levels.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_lummaMatte.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mapUV.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mapValue.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_math.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mixrgb.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_movieclip.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_moviedistortion.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normal.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normalize.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_outputFile.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_premulkey.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_rgb.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_rotate.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_scale.c13
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c15
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c15
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_setalpha.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_splitViewer.c13
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_stabilize2d.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_texture.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_tonemap.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_transform.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_translate.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_valToRgb.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_value.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_vecBlur.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_viewer.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_zcombine.c7
-rw-r--r--source/blender/nodes/intern/node_common.c6
-rw-r--r--source/blender/nodes/intern/node_exec.c16
-rw-r--r--source/blender/nodes/intern/node_util.c61
-rw-r--r--source/blender/nodes/intern/node_util.h11
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c6
-rw-r--r--source/blender/nodes/shader/node_shader_util.c63
-rw-r--r--source/blender/nodes/shader/node_shader_util.h3
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_add_shader.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_attribute.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_background.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c16
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_camera.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_common.c18
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_curves.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_dynamic.c14
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_emission.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_fresnel.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_geom.c7
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_geometry.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_holdout.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_hueSatVal.c9
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_invert.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_layer_weight.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_light_path.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_mapping.c6
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_material.c14
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_math.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_mixRgb.c7
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_mix_shader.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_normal.c6
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output.c12
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output_lamp.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output_material.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output_world.c15
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_rgb.c7
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_squeeze.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_coord.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_environment.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_gradient.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_image.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_magic.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_noise.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_sky.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_wave.c11
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_texture.c12
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_valToRgb.c14
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_value.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_vectMath.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_transparent.c15
-rw-r--r--source/blender/nodes/texture/node_texture_tree.c6
-rw-r--r--source/blender/nodes/texture/node_texture_util.c92
-rw-r--r--source/blender/nodes/texture/node_texture_util.h2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_at.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_bricks.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_checker.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_common.c18
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_compose.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_coord.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_curves.c13
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_decompose.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_distance.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_hueSatVal.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_image.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_invert.c7
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_math.c7
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_mixRgb.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_output.c9
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_proc.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_rotate.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_scale.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_texture.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_translate.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_valToNor.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_valToRgb.c13
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_viewer.c9
-rw-r--r--source/blender/python/BPY_extern.h2
-rw-r--r--source/blender/python/generic/CMakeLists.txt4
-rw-r--r--source/blender/python/generic/idprop_py_api.c (renamed from source/blender/python/generic/IDProp.c)407
-rw-r--r--source/blender/python/generic/idprop_py_api.h (renamed from source/blender/python/generic/IDProp.h)11
-rw-r--r--source/blender/python/generic/noise_py_api.c18
-rw-r--r--source/blender/python/intern/bpy.c2
-rw-r--r--source/blender/python/intern/bpy_driver.c35
-rw-r--r--source/blender/python/intern/bpy_driver.h2
-rw-r--r--source/blender/python/intern/bpy_props.c11
-rw-r--r--source/blender/python/intern/bpy_rna.c267
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c50
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c36
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c17
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c271
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c294
-rw-r--r--source/blender/render/CMakeLists.txt2
-rw-r--r--source/blender/render/extern/include/RE_pipeline.h1
-rw-r--r--source/blender/render/intern/include/render_types.h3
-rw-r--r--source/blender/render/intern/include/texture_ocean.h28
-rw-r--r--source/blender/render/intern/source/convertblender.c2
-rw-r--r--source/blender/render/intern/source/envmap.c12
-rw-r--r--source/blender/render/intern/source/external_engine.c5
-rw-r--r--source/blender/render/intern/source/initrender.c59
-rw-r--r--source/blender/render/intern/source/pipeline.c18
-rw-r--r--source/blender/render/intern/source/render_texture.c30
-rw-r--r--source/blender/render/intern/source/shadeoutput.c2
-rw-r--r--source/blender/render/intern/source/texture_ocean.c157
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/WM_keymap.h2
-rw-r--r--source/blender/windowmanager/intern/wm.c20
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c11
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c10
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c7
-rw-r--r--source/creator/CMakeLists.txt183
-rw-r--r--source/creator/creator.c8
-rw-r--r--source/gameengine/Ketsji/BL_Shader.cpp9
-rw-r--r--source/tests/pep8.py27
388 files changed, 10338 insertions, 5145 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 3bce3878d72..2ba23e501b4 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -34,6 +34,8 @@
#include "BLF_api.h"
+#include "BLF_translation.h" /* own include */
+
#ifdef WITH_INTERNATIONAL
#include <locale.h>
@@ -76,7 +78,7 @@ static const char *locales[] = {
"finnish", "fi_FI",
"swedish", "sv_SE",
"french", "fr_FR",
- "spanish", "es_ES",
+ "spanish", "es",
"catalan", "ca_AD",
"czech", "cs_CZ",
"ptb", "pt_BR",
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index 8688249732f..fe14f5d4d1c 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -47,7 +47,7 @@
#include "DNA_userdef_types.h" /* For user settings. */
#ifdef WITH_INTERNATIONAL
-const char unifont_filename[]="droidsans.ttf.gz";
+static const char unifont_filename[]="droidsans.ttf.gz";
static unsigned char *unifont_ttf= NULL;
static int unifont_size= 0;
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index b150c403b87..fdd876ff29b 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 260
-#define BLENDER_SUBVERSION 3
+#define BLENDER_SUBVERSION 5
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
@@ -51,7 +51,9 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR a
/* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE alpha
+#define BLENDER_VERSION_CYCLE beta
+
+extern char versionstr[]; /* from blender.c */
struct ListBase;
struct MemFile;
diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h
index d21c1092922..72e22dc1583 100644
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@ -36,33 +36,90 @@
extern "C" {
#endif
+#include "DNA_vec_types.h"
+
struct Camera;
struct Object;
+struct RegionView3D;
struct RenderData;
struct Scene;
struct rctf;
+struct View3D;
+
+/* Camera Datablock */
void *add_camera(const char *name);
struct Camera *copy_camera(struct Camera *cam);
void make_local_camera(struct Camera *cam);
void free_camera(struct Camera *ca);
-float dof_camera(struct Object *ob);
+/* Camera Usage */
+
+float object_camera_dof_distance(struct Object *ob);
+void object_camera_mode(struct RenderData *rd, struct Object *ob);
+
+int camera_sensor_fit(int sensor_fit, float sizex, float sizey);
+float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y);
+
+/* Camera Parameters:
+ *
+ * Intermediate struct for storing camera parameters from various sources,
+ * to unify computation of viewplane, window matrix, ... */
+
+typedef struct CameraParams {
+ /* lens */
+ int is_ortho;
+ float lens;
+ float ortho_scale;
+ float zoom;
+
+ float shiftx;
+ float shifty;
+ float offsetx;
+ float offsety;
-void object_camera_mode(struct RenderData *rd, struct Object *camera);
-void object_camera_intrinsics(struct Object *camera, struct Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
- float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit);
-void object_camera_matrix(
- struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second,
- float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens,
- float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
- float *viewdx, float *viewdy);
+ /* sensor */
+ float sensor_x;
+ float sensor_y;
+ int sensor_fit;
+
+ /* clipping */
+ float clipsta;
+ float clipend;
+
+ /* fields */
+ int use_fields;
+ int field_second;
+ int field_odd;
+
+ /* computed viewplane */
+ float ycor;
+ float viewdx;
+ float viewdy;
+ rctf viewplane;
+
+ /* computed matrix */
+ float winmat[4][4];
+} CameraParams;
+
+void camera_params_init(CameraParams *params);
+void camera_params_from_object(CameraParams *params, struct Object *camera);
+void camera_params_from_view3d(CameraParams *params, struct View3D *v3d, struct RegionView3D *rv3d);
+
+void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy);
+void camera_params_compute_matrix(CameraParams *params);
+
+/* Camera View Frame */
void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
+int camera_view_frame_fit_to_scene(
+ struct Scene *scene, struct View3D *v3d, struct Object *camera_ob,
+ float r_co[3]);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index d7e0f8bdaae..75b3c5b4f24 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -46,6 +46,7 @@ typedef struct PaintWavePoint {
float height;
float velocity;
+ float brush_isect;
short state;
} PaintWavePoint;
@@ -64,7 +65,7 @@ void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
int dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
-int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int index);
+int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
@@ -82,6 +83,7 @@ void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char*
#define DPAINT_PAINT_NEW 2
/* PaintWavePoint state */
+#define DPAINT_WAVE_ISECT_CHANGED -1
#define DPAINT_WAVE_NONE 0
#define DPAINT_WAVE_OBSTACLE 1
#define DPAINT_WAVE_REFLECT_ONLY 2
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 10c02f54b2e..fbe5bf2ef44 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -40,7 +40,11 @@ typedef union IDPropertyTemplate {
int i;
float f;
double d;
- char *str;
+ struct {
+ char *str;
+ short len;
+ char subtype;
+ } string;
struct ID *id;
struct {
short type;
@@ -183,7 +187,7 @@ 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(int type, IDPropertyTemplate val, const char *name);
+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
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index adb34f4c501..a3e0b5b6d5a 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -52,7 +52,7 @@ void BKE_stamp_buf(struct Scene *scene, struct Object *camera, unsigned char *re
int BKE_alphatest_ibuf(struct ImBuf *ibuf);
int BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, int imtype, int subimtype, int quality);
int BKE_write_ibuf(struct ImBuf *ibuf, const char *name, int imtype, int subimtype, int quality);
-void BKE_makepicstring(char *string, const char *base, int frame, int imtype, const short use_ext, const short use_frames);
+void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, int imtype, const short use_ext, const short use_frames);
int BKE_add_image_extension(char *string, int imtype);
int BKE_ftype_to_imtype(int ftype);
int BKE_imtype_to_ftype(int imtype);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index a47cefe6f65..84f8995b480 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -364,5 +364,8 @@ void test_object_modifiers(struct Object *ob);
/* here for do_versions */
void modifier_mdef_compact_influences(struct ModifierData *md);
+void modifier_path_init(char *path, int path_maxlen, const char *name);
+const char *modifier_path_relbase(struct Object *ob);
+
#endif
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 580f78d3063..82e42ae27e2 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -190,10 +190,24 @@ typedef struct bNodeType {
* when a final generic version of execution code is defined, this will be changed anyway
*/
void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
+ /* This is the muting callback.
+ * XXX Mimics the newexecfunc signature... Not sure all of this will be useful, we will see.
+ */
+ void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
+ /* And the muting util.
+ * Returns links as a ListBase, as pairs of bNodeStack* if in/out bNodeStacks were provided,
+ * else as pairs of bNodeSocket* if node tree was provided.
+ */
+ ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
+ struct GPUNodeStack *, struct GPUNodeStack *);
/* gpu */
int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
/* extended gpu function */
int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out);
+ /* This is the muting gpu callback.
+ * XXX Mimics the gpuextfunc signature... Not sure all of this will be useful, we will see.
+ */
+ int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
} bNodeType;
/* node->exec, now in use for composites (#define for break is same as ready yes) */
@@ -270,6 +284,13 @@ typedef struct bNodeTreeType
void (*update_node)(struct bNodeTree *ntree, struct bNode *node);
int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
+
+ /* Default muting pointers. */
+ void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
+ ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
+ struct GPUNodeStack *, struct GPUNodeStack *);
+ /* gpu */
+ int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
} bNodeTreeType;
/* ************** GENERIC API, TREES *************** */
@@ -325,7 +346,7 @@ struct bNode *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
-void nodeRegisterType(struct ListBase *typelist, struct bNodeType *ntype) ;
+void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype) ;
void nodeMakeDynamicType(struct bNode *node);
int nodeDynamicUnlinkText(struct ID *txtid);
@@ -368,7 +389,8 @@ struct bNodeTree *nodeGroupEditSet(struct bNode *node, int edit);
void nodeGroupEditClear(struct bNode *node);
/* Init a new node type struct with default values and callbacks */
-void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag);
+void node_type_base(struct bNodeTreeType *ttype, struct bNodeType *ntype, int type,
+ const char *name, short nclass, short flag);
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs);
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth);
void node_type_init(struct bNodeType *ntype, void (*initfunc)(struct bNodeTree *ntree, struct bNode *node, struct bNodeTemplate *ntemp));
@@ -390,13 +412,25 @@ void node_type_group_edit(struct bNodeType *ntype,
struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit),
void (*group_edit_clear)(struct bNode *node));
-void node_type_exec(struct bNodeType *ntype, void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **));
+void node_type_exec(struct bNodeType *ntype, void (*execfunc)(void *data, struct bNode *, struct bNodeStack **,
+ struct bNodeStack **));
void node_type_exec_new(struct bNodeType *ntype,
void *(*initexecfunc)(struct bNode *node),
void (*freeexecfunc)(struct bNode *node, void *nodedata),
- void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **));
-void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out));
-void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out));
+ void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata,
+ struct bNodeStack **, struct bNodeStack **));
+void node_type_mute(struct bNodeType *ntype,
+ void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata,
+ struct bNodeStack **, struct bNodeStack **),
+ ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **,
+ struct bNodeStack **, struct GPUNodeStack*, struct GPUNodeStack*));
+void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node,
+ struct GPUNodeStack *in, struct GPUNodeStack *out));
+void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node,
+ void *nodedata, struct GPUNodeStack *in,
+ struct GPUNodeStack *out));
+void node_type_gpu_mute(struct bNodeType *ntype, int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *,
+ struct GPUNodeStack *, struct GPUNodeStack *));
void node_type_compatibility(struct bNodeType *ntype, short compatibility);
/* ************** COMMON NODES *************** */
@@ -421,7 +455,7 @@ struct bNode *node_group_make_from_selected(struct bNodeTree *ntree);
int node_group_ungroup(struct bNodeTree *ntree, struct bNode *gnode);
/* in node_common.c */
-void register_node_type_frame(ListBase *lb);
+void register_node_type_frame(struct bNodeTreeType *ttype);
/* ************** SHADER NODES *************** */
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index ecc00901dd5..5eb9529b2fc 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -94,7 +94,6 @@ void object_to_mat3(struct Object *ob, float mat[][3]);
void object_to_mat4(struct Object *ob, float mat[][4]);
void object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent);
-void set_no_parent_ipo(int val);
struct Object *object_pose_armature_get(struct Object *ob);
void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime);
@@ -110,6 +109,17 @@ void object_set_dimensions(struct Object *ob, const float *value);
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, float *max);
+
+/* sometimes min-max isnt 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);
+void BKE_scene_foreach_display_point(
+ struct Scene *scene,
+ struct View3D *v3d,
+ const short flag,
+ void (*func_cb)(const float[3], void *), void *user_data);
+
void solve_tracking (struct Object *ob, float targetmat[][4]);
int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
diff --git a/source/blender/blenkernel/BKE_ocean.h b/source/blender/blenkernel/BKE_ocean.h
new file mode 100644
index 00000000000..c8ce3f8ce63
--- /dev/null
+++ b/source/blender/blenkernel/BKE_ocean.h
@@ -0,0 +1,110 @@
+/*
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: Matt Ebb
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_OCEAN_H
+#define BKE_OCEAN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct OceanResult {
+ float disp[3];
+ float normal[3];
+ float foam;
+
+ /* raw eigenvalues/vectors */
+ float Jminus;
+ float Jplus;
+ float Eminus[3];
+ float Eplus[3];
+} OceanResult;
+
+
+typedef struct OceanCache {
+ struct ImBuf **ibufs_disp;
+ struct ImBuf **ibufs_foam;
+ struct ImBuf **ibufs_norm;
+
+ const char *bakepath;
+ const char *relbase;
+
+ /* precalculated for time range */
+ float *time;
+
+ /* constant for time range */
+ float wave_scale;
+ float chop_amount;
+ float foam_coverage;
+ float foam_fade;
+
+ int start;
+ int end;
+ int duration;
+ int resolution_x;
+ int resolution_y;
+
+ int baked;
+} OceanCache;
+
+
+#define OCEAN_NOT_CACHED 0
+#define OCEAN_CACHING 1
+#define OCEAN_CACHED 2
+
+
+struct Ocean *BKE_add_ocean(void);
+void BKE_free_ocean_data(struct Ocean *oc);
+void BKE_free_ocean(struct Ocean *oc);
+
+void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
+ float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed);
+void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount);
+
+/* sampling the ocean surface */
+float BKE_ocean_jminus_to_foam(float jminus, float coverage);
+void BKE_ocean_eval_uv(struct Ocean * oc, struct OceanResult *ocr, float u, float v);
+void BKE_ocean_eval_uv_catrom(struct Ocean * oc, struct OceanResult *ocr, float u, float v);
+void BKE_ocean_eval_xz(struct Ocean * oc, struct OceanResult *ocr, float x, float z);
+void BKE_ocean_eval_xz_catrom(struct Ocean * oc, struct OceanResult *ocr, float x, float z);
+void BKE_ocean_eval_ij(struct Ocean * oc, struct OceanResult *ocr, int i, int j);
+
+
+/* ocean cache handling */
+struct OceanCache *BKE_init_ocean_cache(const char *bakepath, const char *relbase,
+ int start, int end, float wave_scale,
+ float chop_amount, float foam_coverage, float foam_fade, int resolution);
+void BKE_simulate_ocean_cache(struct OceanCache *och, int frame);
+
+void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(void *, float progress, int *cancel), void *update_cb_data);
+void BKE_ocean_cache_eval_uv(struct OceanCache *och, struct OceanResult *ocr, int f, float u, float v);
+void BKE_ocean_cache_eval_ij(struct OceanCache *och, struct OceanResult *ocr, int f, int i, int j);
+
+void BKE_free_ocean_cache(struct OceanCache *och);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index ad394f9fb1a..7cb31505430 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -44,6 +44,7 @@ struct Main;
struct Object;
struct QuicktimeCodecData;
struct RenderData;
+struct SceneRenderLayer;
struct Scene;
struct Text;
struct Text;
@@ -93,7 +94,8 @@ void scene_clear_tagged(struct Main *bmain, struct Scene *sce);
void scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay);
-void scene_add_render_layer(struct Scene *sce);
+struct SceneRenderLayer *scene_add_render_layer(struct Scene *sce, const char *name);
+int scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
/* render profile */
int get_render_subsurf_level(struct RenderData *r, int level);
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 77a351d534e..44b92f70519 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -207,6 +207,7 @@ typedef struct MenuType {
char idname[BKE_ST_MAXNAME]; /* unique name */
char label[BKE_ST_MAXNAME]; /* for button text */
+ char *description;
/* verify if the menu should draw or not */
int (*poll)(const struct bContext *, struct MenuType *);
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index 508fef8d9a4..52fa52a5899 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -46,6 +46,7 @@ struct Lamp;
struct LampRen;
struct Material;
struct MTex;
+struct OceanTex;
struct ParticleSettings;
struct PluginTex;
struct PointDensity;
@@ -125,6 +126,10 @@ void BKE_free_voxeldata(struct VoxelData *vd);
struct VoxelData *BKE_add_voxeldata(void);
struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
+void BKE_free_oceantex(struct OceanTex *ot);
+struct OceanTex *BKE_add_oceantex(void);
+struct OceanTex *BKE_copy_oceantex(struct OceanTex *ot);
+
int BKE_texture_dependsOnTime(const struct Tex *texture);
#ifdef __cplusplus
diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index a8fb2c836de..af852d49d82 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -91,6 +91,8 @@ void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingCont
int BKE_tracking_next(struct MovieTrackingContext *context);
/* Camera solving */
+int BKE_tracking_can_solve(struct MovieTracking *tracking, char *error_msg, int error_size);
+
float BKE_tracking_solve_reconstruction(struct MovieTracking *tracking, int width, int height);
struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking, int framenr);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 4f909a59e8e..353b73a271c 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -119,6 +119,7 @@ set(SRC
intern/multires.c
intern/nla.c
intern/node.c
+ intern/ocean.c
intern/object.c
intern/packedFile.c
intern/paint.c
@@ -207,6 +208,7 @@ set(SRC
BKE_multires.h
BKE_nla.h
BKE_node.h
+ BKE_ocean.h
BKE_object.h
BKE_packedFile.h
BKE_paint.h
@@ -344,6 +346,10 @@ if(WITH_MOD_SMOKE)
add_definitions(-DWITH_SMOKE)
endif()
+if(WITH_MOD_OCEANSIM)
+ add_definitions(-DWITH_OCEANSIM)
+endif()
+
if(WITH_JACK)
add_definitions(-DWITH_JACK)
endif()
@@ -381,6 +387,13 @@ if(WITH_LIBMV)
add_definitions(-DWITH_LIBMV)
endif()
+if(WITH_FFTW3)
+ list(APPEND INC_SYS
+ ${FFTW3_INCLUDE_DIRS}
+ )
+ add_definitions(-DFFTW3=1)
+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 53b59077f73..b5d4915f8d4 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -82,6 +82,9 @@ if env['OURPLATFORM'] == 'darwin':
if env['WITH_BF_FLUID']:
defs.append('WITH_MOD_FLUID')
+if env['WITH_BF_OCEANSIM']:
+ defs.append('WITH_OCEANSIM')
+
if env['WITH_BF_LZO']:
incs += ' #/extern/lzo/minilzo'
defs.append('WITH_LZO')
@@ -100,6 +103,10 @@ if env['WITH_BF_LIBMV']:
incs += ' #/extern/libmv'
defs.append('WITH_LIBMV')
+if env['WITH_BF_FFTW3']:
+ defs.append('FFTW3=1')
+ incs += ' ' + env['BF_FFTW3_INC']
+
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c
index 8a6426eb3d5..67215b5e40f 100644
--- a/source/blender/blenkernel/intern/BME_Customdata.c
+++ b/source/blender/blenkernel/intern/BME_Customdata.c
@@ -86,7 +86,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc
if(data->totlayer){
/*alloc memory*/
data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers");
- data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc, 0);
+ data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc, FALSE, FALSE);
/*initialize layer data*/
for(i=0; i < BME_CD_NUMTYPES; i++){
if(init->layout[i]){
diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c
index 1b5761fb94e..cda66de6f22 100644
--- a/source/blender/blenkernel/intern/BME_mesh.c
+++ b/source/blender/blenkernel/intern/BME_mesh.c
@@ -55,10 +55,10 @@ BME_Mesh *BME_make_mesh(int allocsize[4])
/*allocate the structure*/
BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh");
/*allocate the memory pools for the mesh elements*/
- bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0], 0);
- bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1], 0);
- bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2], 0);
- bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3], 0);
+ bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0], FALSE, FALSE);
+ bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1], FALSE, FALSE);
+ bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2], FALSE, FALSE);
+ bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3], FALSE, FALSE);
return bm;
}
/*
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index f8186c25a68..d47bf8cb436 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1380,17 +1380,17 @@ void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap,
static float nlastrip_get_influence (NlaStrip *strip, float cframe)
{
/* sanity checks - normalise the blendin/out values? */
- strip->blendin= (float)fabs(strip->blendin);
- strip->blendout= (float)fabs(strip->blendout);
+ strip->blendin= fabsf(strip->blendin);
+ strip->blendout= fabsf(strip->blendout);
/* result depends on where frame is in respect to blendin/out values */
if (IS_EQ(strip->blendin, 0)==0 && (cframe <= (strip->start + strip->blendin))) {
/* there is some blend-in */
- return (float)fabs(cframe - strip->start) / (strip->blendin);
+ return fabsf(cframe - strip->start) / (strip->blendin);
}
else if (IS_EQ(strip->blendout, 0)==0 && (cframe >= (strip->end - strip->blendout))) {
/* there is some blend-out */
- return (float)fabs(strip->end - cframe) / (strip->blendout);
+ return fabsf(strip->end - cframe) / (strip->blendout);
}
else {
/* in the middle of the strip, we should be full strength */
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 145eb9363e9..08e8a80750e 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -35,15 +35,20 @@
#include "DNA_lamp_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_view3d_types.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_animsys.h"
#include "BKE_camera.h"
+#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
+#include "BKE_screen.h"
+
+/****************************** Camera Datablock *****************************/
void *add_camera(const char *name)
{
@@ -69,7 +74,9 @@ Camera *copy_camera(Camera *cam)
Camera *camn;
camn= copy_libblock(&cam->id);
-
+
+ id_lib_extern((ID *)camn->dof_ob);
+
return camn;
}
@@ -120,8 +127,26 @@ void make_local_camera(Camera *cam)
}
}
+void free_camera(Camera *ca)
+{
+ BKE_free_animdata((ID *)ca);
+}
+
+/******************************** Camera Usage *******************************/
+
+void object_camera_mode(RenderData *rd, Object *cam_ob)
+{
+ rd->mode &= ~(R_ORTHO|R_PANORAMA);
+
+ 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;
+ }
+}
+
/* get the camera's dof value, takes the dof object into account */
-float dof_camera(Object *ob)
+float object_camera_dof_distance(Object *ob)
{
Camera *cam = (Camera *)ob->data;
if (ob->type != OB_CAMERA)
@@ -135,180 +160,212 @@ float dof_camera(Object *ob)
normalize_m4(obmat);
invert_m4_m4(imat, obmat);
mul_m4_m4m4(mat, cam->dof_ob->obmat, imat);
- return (float)fabs(mat[3][2]);
+ return fabsf(mat[3][2]);
}
return cam->YF_dofdist;
}
-void free_camera(Camera *ca)
+float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
{
- BKE_free_animdata((ID *)ca);
+ /* sensor size used to fit to. for auto, sensor_x is both x and y. */
+ if(sensor_fit == CAMERA_SENSOR_FIT_VERT)
+ return sensor_y;
+
+ return sensor_x;
}
-void object_camera_mode(RenderData *rd, Object *camera)
+int camera_sensor_fit(int sensor_fit, float sizex, float sizey)
{
- rd->mode &= ~(R_ORTHO|R_PANORAMA);
- if(camera && camera->type==OB_CAMERA) {
- Camera *cam= camera->data;
- if(cam->type == CAM_ORTHO) rd->mode |= R_ORTHO;
- if(cam->flag & CAM_PANORAMA) rd->mode |= R_PANORAMA;
+ if(sensor_fit == CAMERA_SENSOR_FIT_AUTO) {
+ if(sizex >= sizey)
+ return CAMERA_SENSOR_FIT_HOR;
+ else
+ return CAMERA_SENSOR_FIT_VERT;
}
+
+ return sensor_fit;
+}
+
+/******************************** Camera Params *******************************/
+
+void camera_params_init(CameraParams *params)
+{
+ memset(params, 0, sizeof(CameraParams));
+
+ /* defaults */
+ params->sensor_x= DEFAULT_SENSOR_WIDTH;
+ params->sensor_y= DEFAULT_SENSOR_HEIGHT;
+ params->sensor_fit= CAMERA_SENSOR_FIT_AUTO;
+
+ params->zoom= 1.0f;
}
-void object_camera_intrinsics(Object *camera, Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
- float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit)
+void camera_params_from_object(CameraParams *params, Object *ob)
{
- Camera *cam= NULL;
+ if(!ob)
+ return;
- (*shiftx)= 0.0f;
- (*shifty)= 0.0f;
+ if(ob->type==OB_CAMERA) {
+ /* camera object */
+ Camera *cam= ob->data;
- (*sensor_x)= DEFAULT_SENSOR_WIDTH;
- (*sensor_y)= DEFAULT_SENSOR_HEIGHT;
- (*sensor_fit)= CAMERA_SENSOR_FIT_AUTO;
+ if(cam->type == CAM_ORTHO)
+ params->is_ortho= TRUE;
+ params->lens= cam->lens;
+ params->ortho_scale= cam->ortho_scale;
- if(camera->type==OB_CAMERA) {
- cam= camera->data;
+ params->shiftx= cam->shiftx;
+ params->shifty= cam->shifty;
- if(cam->type == CAM_ORTHO) {
- *is_ortho= TRUE;
- }
+ params->sensor_x= cam->sensor_x;
+ params->sensor_y= cam->sensor_y;
+ params->sensor_fit= cam->sensor_fit;
- /* solve this too... all time depending stuff is in convertblender.c?
- * Need to update the camera early because it's used for projection matrices
- * and other stuff BEFORE the animation update loop is done
- * */
-#if 0 // XXX old animation system
- if(cam->ipo) {
- calc_ipo(cam->ipo, frame_to_float(re->scene, re->r.cfra));
- execute_ipo(&cam->id, cam->ipo);
- }
-#endif // XXX old animation system
- (*shiftx)=cam->shiftx;
- (*shifty)=cam->shifty;
- (*lens)= cam->lens;
- (*sensor_x)= cam->sensor_x;
- (*sensor_y)= cam->sensor_y;
- (*clipsta)= cam->clipsta;
- (*clipend)= cam->clipend;
- (*sensor_fit)= cam->sensor_fit;
+ params->clipsta= cam->clipsta;
+ params->clipend= cam->clipend;
}
- else if(camera->type==OB_LAMP) {
- Lamp *la= camera->data;
+ 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);
- (*lens)= 16.0f*fac/sinf(phi);
- if((*lens)==0.0f)
- (*lens)= 35.0f;
- (*clipsta)= la->clipsta;
- (*clipend)= la->clipend;
- }
- else { /* envmap exception... */;
- if((*lens)==0.0f) /* is this needed anymore? */
- (*lens)= 16.0f;
+ params->lens= 16.0f*fac/sinf(phi);
+ if(params->lens==0.0f)
+ params->lens= 35.0f;
- if((*clipsta)==0.0f || (*clipend)==0.0f) {
- (*clipsta)= 0.1f;
- (*clipend)= 1000.0f;
- }
+ params->clipsta= la->clipsta;
+ params->clipend= la->clipend;
}
-
- (*cam_r)= cam;
}
-/* 'lens' may be set for envmap only */
-void object_camera_matrix(
- RenderData *rd, Object *camera, int winx, int winy, short field_second,
- float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens,
- float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
- float *viewdx, float *viewdy)
+void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *rv3d)
{
- Camera *cam=NULL;
- float pixsize;
- float shiftx=0.0, shifty=0.0, winside, viewfac;
- short is_ortho= FALSE;
-
- /* question mark */
- (*ycor)= rd->yasp / rd->xasp;
- if(rd->mode & R_FIELDS)
- (*ycor) *= 2.0f;
-
- object_camera_intrinsics(camera, &cam, &is_ortho, &shiftx, &shifty, clipsta, clipend, lens, sensor_x, sensor_y, sensor_fit);
-
- /* ortho only with camera available */
- if(cam && is_ortho) {
- if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
- if(rd->xasp*winx >= rd->yasp*winy) viewfac= winx;
- else viewfac= (*ycor) * winy;
- }
- else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
- viewfac= winx;
- }
- else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
- viewfac= (*ycor) * winy;
- }
+ /* common */
+ params->lens= v3d->lens;
+ params->clipsta= v3d->near;
+ params->clipend= v3d->far;
+
+ if(rv3d->persp==RV3D_CAMOB) {
+ /* camera view */
+ camera_params_from_object(params, v3d->camera);
+
+ params->zoom= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom);
- /* ortho_scale == 1.0 means exact 1 to 1 mapping */
- pixsize= cam->ortho_scale/viewfac;
+ params->offsetx= 2.0f*rv3d->camdx*params->zoom;
+ params->offsety= 2.0f*rv3d->camdy*params->zoom;
+
+ params->shiftx *= params->zoom;
+ params->shifty *= params->zoom;
+
+ params->zoom= 1.0f/params->zoom;
+ }
+ else if(rv3d->persp==RV3D_ORTHO) {
+ /* orthographic view */
+ params->clipend *= 0.5f; // otherwise too extreme low zbuffer quality
+ params->clipsta= - params->clipend;
+
+ params->is_ortho= TRUE;
+ params->ortho_scale = rv3d->dist;
+ params->zoom= 2.0f;
}
else {
- if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
- if(rd->xasp*winx >= rd->yasp*winy) viewfac= ((*lens) * winx) / (*sensor_x);
- else viewfac= (*ycor) * ((*lens) * winy) / (*sensor_x);
- }
- else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
- viewfac= ((*lens) * winx) / (*sensor_x);
- }
- else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
- viewfac= ((*lens) * winy) / (*sensor_y);
- }
-
- pixsize= (*clipsta) / viewfac;
+ /* perspective view */
+ params->zoom= 2.0f;
}
+}
- /* viewplane fully centered, zbuffer fills in jittered between -.5 and +.5 */
- winside= MAX2(winx, winy);
-
- if(cam) {
- if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR)
- winside= winx;
- else if(cam->sensor_fit==CAMERA_SENSOR_FIT_VERT)
- winside= winy;
+void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float xasp, float yasp)
+{
+ rctf viewplane;
+ float pixsize, viewfac, sensor_size, dx, dy;
+ int sensor_fit;
+
+ /* fields rendering */
+ params->ycor= yasp/xasp;
+ if(params->use_fields)
+ params->ycor *= 2.0f;
+
+ if(params->is_ortho) {
+ /* orthographic camera */
+ /* scale == 1.0 means exact 1 to 1 mapping */
+ pixsize= params->ortho_scale;
+ }
+ else {
+ /* perspective camera */
+ sensor_size= camera_sensor_size(params->sensor_fit, params->sensor_x, params->sensor_y);
+ pixsize= (sensor_size * params->clipsta)/params->lens;
}
- viewplane->xmin= -0.5f*(float)winx + shiftx*winside;
- viewplane->ymin= -0.5f*(*ycor)*(float)winy + shifty*winside;
- viewplane->xmax= 0.5f*(float)winx + shiftx*winside;
- viewplane->ymax= 0.5f*(*ycor)*(float)winy + shifty*winside;
+ /* determine sensor fit */
+ sensor_fit = camera_sensor_fit(params->sensor_fit, xasp*winx, yasp*winy);
- if(field_second) {
- if(rd->mode & R_ODDFIELD) {
- viewplane->ymin-= 0.5f * (*ycor);
- viewplane->ymax-= 0.5f * (*ycor);
+ if(sensor_fit==CAMERA_SENSOR_FIT_HOR)
+ viewfac= winx;
+ else
+ viewfac= params->ycor * winy;
+
+ pixsize /= viewfac;
+
+ /* extra zoom factor */
+ pixsize *= params->zoom;
+
+ /* 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;
+
+ /* lens shift and offset */
+ dx= params->shiftx*viewfac + winx*params->offsetx;
+ dy= params->shifty*viewfac + winy*params->offsety;
+
+ viewplane.xmin += dx;
+ viewplane.ymin += dy;
+ viewplane.xmax += dx;
+ viewplane.ymax += dy;
+
+ /* fields offset */
+ if(params->field_second) {
+ if(params->field_odd) {
+ viewplane.ymin-= 0.5f * params->ycor;
+ viewplane.ymax-= 0.5f * params->ycor;
}
else {
- viewplane->ymin+= 0.5f * (*ycor);
- viewplane->ymax+= 0.5f * (*ycor);
+ viewplane.ymin+= 0.5f * params->ycor;
+ viewplane.ymax+= 0.5f * params->ycor;
}
}
+
/* the window matrix is used for clipping, and not changed during OSA steps */
/* using an offset of +0.5 here would give clip errors on edges */
- viewplane->xmin *= pixsize;
- viewplane->xmax *= pixsize;
- viewplane->ymin *= pixsize;
- viewplane->ymax *= pixsize;
+ viewplane.xmin *= pixsize;
+ viewplane.xmax *= pixsize;
+ viewplane.ymin *= pixsize;
+ viewplane.ymax *= pixsize;
+
+ params->viewdx= pixsize;
+ params->viewdy= params->ycor * pixsize;
+ params->viewplane= viewplane;
+}
- (*viewdx)= pixsize;
- (*viewdy)= (*ycor) * pixsize;
+/* viewplane is assumed to be already computed */
+void camera_params_compute_matrix(CameraParams *params)
+{
+ rctf viewplane= params->viewplane;
- if(is_ortho)
- orthographic_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend);
+ /* compute projection matrix */
+ if(params->is_ortho)
+ orthographic_m4(params->winmat, viewplane.xmin, viewplane.xmax,
+ viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
else
- perspective_m4(winmat, viewplane->xmin, viewplane->xmax, viewplane->ymin, viewplane->ymax, *clipsta, *clipend);
-
+ perspective_m4(params->winmat, viewplane.xmin, viewplane.xmax,
+ viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
}
+/***************************** Camera View Frame *****************************/
+
void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3],
float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
{
@@ -319,25 +376,16 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
if (scene) {
float aspx= (float) scene->r.xsch*scene->r.xasp;
float aspy= (float) scene->r.ysch*scene->r.yasp;
+ int sensor_fit= camera_sensor_fit(camera->sensor_fit, aspx, aspy);
- if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- if(aspx < aspy) {
- r_asp[0]= aspx / aspy;
- r_asp[1]= 1.0;
- }
- else {
- r_asp[0]= 1.0;
- r_asp[1]= aspy / aspx;
- }
+ if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+ r_asp[0]= 1.0;
+ r_asp[1]= aspy / aspx;
}
- else if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+ else {
r_asp[0]= aspx / aspy;
r_asp[1]= 1.0;
}
- else {
- r_asp[0]= 1.0;
- r_asp[1]= aspy / aspx;
- }
}
else {
r_asp[0]= 1.0f;
@@ -394,3 +442,137 @@ void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
}
+
+typedef struct CameraViewFrameData {
+ float frame_tx[4][3];
+ float normal_tx[4][3];
+ float dist_vals[4];
+ unsigned int tot;
+} CameraViewFrameData;
+
+static void camera_to_frame_view_cb(const float co[3], void *user_data)
+{
+ CameraViewFrameData *data= (CameraViewFrameData *)user_data;
+ unsigned int i;
+
+ for (i= 0; i < 4; i++) {
+ float nd= dist_to_plane_v3(co, data->frame_tx[i], data->normal_tx[i]);
+ if (nd < data->dist_vals[i]) {
+ data->dist_vals[i]= nd;
+ }
+ }
+
+ data->tot++;
+}
+
+/* dont 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])
+{
+ float shift[2];
+ float plane_tx[4][3];
+ float rot_obmat[3][3];
+ const float zero[3]= {0,0,0};
+ CameraViewFrameData data_cb;
+
+ unsigned int i;
+
+ camera_view_frame(scene, camera_ob->data, data_cb.frame_tx);
+
+ copy_m3_m4(rot_obmat, camera_ob->obmat);
+ normalize_m3(rot_obmat);
+
+ for (i= 0; i < 4; i++) {
+ /* normalize so Z is always 1.0f*/
+ mul_v3_fl(data_cb.frame_tx[i], 1.0f/data_cb.frame_tx[i][2]);
+ }
+
+ /* get the shift back out of the frame */
+ shift[0]= (data_cb.frame_tx[0][0] +
+ data_cb.frame_tx[1][0] +
+ data_cb.frame_tx[2][0] +
+ data_cb.frame_tx[3][0]) / 4.0f;
+ shift[1]= (data_cb.frame_tx[0][1] +
+ data_cb.frame_tx[1][1] +
+ data_cb.frame_tx[2][1] +
+ data_cb.frame_tx[3][1]) / 4.0f;
+
+ for (i= 0; i < 4; i++) {
+ mul_m3_v3(rot_obmat, data_cb.frame_tx[i]);
+ }
+
+ for (i= 0; i < 4; i++) {
+ normal_tri_v3(data_cb.normal_tx[i],
+ zero, data_cb.frame_tx[i], data_cb.frame_tx[(i + 1) % 4]);
+ }
+
+ /* initialize callback data */
+ data_cb.dist_vals[0]=
+ data_cb.dist_vals[1]=
+ data_cb.dist_vals[2]=
+ data_cb.dist_vals[3]= FLT_MAX;
+ data_cb.tot= 0;
+ /* run callback on all visible points */
+ BKE_scene_foreach_display_point(scene, v3d, BA_SELECT,
+ camera_to_frame_view_cb, &data_cb);
+
+ if (data_cb.tot <= 1) {
+ return FALSE;
+ }
+ else {
+ float plane_isect_1[3], plane_isect_1_no[3], plane_isect_1_other[3];
+ float plane_isect_2[3], plane_isect_2_no[3], plane_isect_2_other[3];
+
+ float plane_isect_pt_1[3], plane_isect_pt_2[3];
+
+ /* apply the dist-from-plane's to the transformed plane points */
+ for (i= 0; i < 4; i++) {
+ mul_v3_v3fl(plane_tx[i], data_cb.normal_tx[i], data_cb.dist_vals[i]);
+ }
+
+ isect_plane_plane_v3(plane_isect_1, plane_isect_1_no,
+ plane_tx[0], data_cb.normal_tx[0],
+ plane_tx[2], data_cb.normal_tx[2]);
+ isect_plane_plane_v3(plane_isect_2, plane_isect_2_no,
+ plane_tx[1], data_cb.normal_tx[1],
+ plane_tx[3], data_cb.normal_tx[3]);
+
+ add_v3_v3v3(plane_isect_1_other, plane_isect_1, plane_isect_1_no);
+ add_v3_v3v3(plane_isect_2_other, plane_isect_2, plane_isect_2_no);
+
+ if (isect_line_line_v3(plane_isect_1, plane_isect_1_other,
+ plane_isect_2, plane_isect_2_other,
+ plane_isect_pt_1, plane_isect_pt_2) == 0)
+ {
+ return FALSE;
+ }
+ else {
+ float cam_plane_no[3]= {0.0f, 0.0f, -1.0f};
+ float plane_isect_delta[3];
+ float plane_isect_delta_len;
+
+ mul_m3_v3(rot_obmat, cam_plane_no);
+
+ sub_v3_v3v3(plane_isect_delta, plane_isect_pt_2, plane_isect_pt_1);
+ plane_isect_delta_len= len_v3(plane_isect_delta);
+
+ if (dot_v3v3(plane_isect_delta, cam_plane_no) > 0.0f) {
+ copy_v3_v3(r_co, plane_isect_pt_1);
+
+ /* offset shift */
+ normalize_v3(plane_isect_1_no);
+ madd_v3_v3fl(r_co, plane_isect_1_no, shift[1] * -plane_isect_delta_len);
+ }
+ else {
+ copy_v3_v3(r_co, plane_isect_pt_2);
+
+ /* offset shift */
+ normalize_v3(plane_isect_2_no);
+ madd_v3_v3fl(r_co, plane_isect_2_no, shift[0] * -plane_isect_delta_len);
+ }
+
+
+ return TRUE;
+ }
+ }
+}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index eaf2afdcfb6..de0bf90e79b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -945,7 +945,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
if(setDrawOptions == NULL) {
/* just draw the entire face array */
- glDrawArrays(GL_TRIANGLES, 0, (tottri-1) * 3);
+ glDrawArrays(GL_TRIANGLES, 0, (tottri) * 3);
}
else {
/* we need to check if the next material changes */
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index f904d6e66df..6f29594f811 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -3936,16 +3936,15 @@ static bConstraintTypeInfo CTI_PIVOT = {
static void followtrack_new_data (void *cdata)
{
bFollowTrackConstraint *data= (bFollowTrackConstraint *)cdata;
-
+
data->clip= NULL;
- data->flag|= FOLLOWTRACK_ACTIVECLIP;
- data->reference= FOLLOWTRACK_TRACK;
+ data->flag |= FOLLOWTRACK_ACTIVECLIP;
}
static void followtrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
{
bFollowTrackConstraint *data= con->data;
-
+
func(con, (ID**)&data->clip, userdata);
}
@@ -3955,104 +3954,102 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
bFollowTrackConstraint *data= con->data;
MovieClip *clip= data->clip;
MovieTrackingTrack *track;
-
- if(data->flag&FOLLOWTRACK_ACTIVECLIP)
+
+ if (data->flag & FOLLOWTRACK_ACTIVECLIP)
clip= scene->clip;
-
- if(!clip || !data->track[0])
+
+ if (!clip || !data->track[0])
return;
-
+
track= BKE_tracking_named_track(&clip->tracking, data->track);
-
- if(!track)
+
+ if (!track)
return;
-
- if(data->reference==FOLLOWTRACK_BUNDLE) {
- if(track->flag&TRACK_HAS_BUNDLE) {
+
+ if (data->flag & FOLLOWTRACK_USE_3D_POSITION) {
+ if (track->flag & TRACK_HAS_BUNDLE) {
float pos[3], mat[4][4], obmat[4][4];
-
+
copy_m4_m4(obmat, cob->matrix);
-
+
BKE_get_tracking_mat(cob->scene, NULL, mat);
mul_v3_m4v3(pos, mat, track->bundle_pos);
-
- cob->matrix[3][0]+= pos[0];
- cob->matrix[3][1]+= pos[1];
- cob->matrix[3][2]+= pos[2];
+
+ cob->matrix[3][0] += pos[0];
+ cob->matrix[3][1] += pos[1];
+ cob->matrix[3][2] += pos[2];
}
- } else {
+ }
+ else {
Object *camob= cob->scene->camera;
-
- if(camob) {
+
+ if (camob) {
MovieClipUser user;
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 sensor_x, sensor_y, lens, len, d, ortho_scale= 1.f;
-
+ float len, d;
+
where_is_object_mat(scene, camob, mat);
-
+
/* camera axis */
- vec[0]= 0.f;
- vec[1]= 0.f;
- vec[2]= 1.f;
+ vec[0]= 0.0f;
+ vec[1]= 0.0f;
+ vec[2]= 1.0f;
mul_v3_m4v3(axis, mat, vec);
-
+
/* distance to projection plane */
copy_v3_v3(vec, cob->matrix[3]);
sub_v3_v3(vec, mat[3]);
project_v3_v3v3(disp, vec, axis);
-
+
len= len_v3(disp);
-
- if(len>FLT_EPSILON) {
- float pos[2], rmat[4][4], shiftx= 0.0f, shifty= 0.0f, clipsta= 0.0f, clipend= 0.0f;
- short is_ortho= 0, sensor_fit= CAMERA_SENSOR_FIT_AUTO;
- Camera *cam= NULL;
-
+
+ if (len > FLT_EPSILON) {
+ CameraParams params;
+ float pos[2], rmat[4][4];
+
user.framenr= scene->r.cfra;
marker= BKE_tracking_get_marker(track, user.framenr);
-
+
add_v2_v2v2(pos, marker->pos, track->offset);
+
+ camera_params_init(&params);
+ camera_params_from_object(&params, camob);
- object_camera_intrinsics(camob, &cam, &is_ortho, &shiftx, &shifty, &clipsta, &clipend, &lens, &sensor_x, &sensor_y, &sensor_fit);
-
- if(is_ortho) {
- if(cam)
- ortho_scale= cam->ortho_scale;
-
- vec[0]= ortho_scale * (pos[0]-0.5f+shiftx);
- vec[1]= ortho_scale * (pos[1]-0.5f+shifty);
+ 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;
-
- if(aspect>1.f) 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);
-
+
copy_m4_m4(rmat, camob->obmat);
zero_v3(rmat[3]);
mul_m4_m4m4(cob->matrix, rmat, cob->matrix);
-
+
copy_v3_v3(cob->matrix[3], disp);
}
else {
- d= (len*sensor_x) / (2.f*lens);
-
- vec[0]= d*(2.f*(pos[0]+shiftx)-1.f);
- vec[1]= d*(2.f*(pos[1]+shifty)-1.f);
+ 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;
-
- if(aspect>1.f) 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);
-
+
/* apply camera rotation so Z-axis would be co-linear */
copy_m4_m4(rmat, camob->obmat);
zero_v3(rmat[3]);
mul_m4_m4m4(cob->matrix, rmat, cob->matrix);
-
+
copy_v3_v3(cob->matrix[3], disp);
}
}
@@ -4081,15 +4078,15 @@ static bConstraintTypeInfo CTI_FOLLOWTRACK = {
static void camerasolver_new_data (void *cdata)
{
bCameraSolverConstraint *data= (bCameraSolverConstraint *)cdata;
-
- data->clip= NULL;
- data->flag|= CAMERASOLVER_ACTIVECLIP;
+
+ data->clip = NULL;
+ data->flag |= CAMERASOLVER_ACTIVECLIP;
}
static void camerasolver_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
{
bCameraSolverConstraint *data= con->data;
-
+
func(con, (ID**)&data->clip, userdata);
}
@@ -4098,15 +4095,15 @@ static void camerasolver_evaluate (bConstraint *con, bConstraintOb *cob, ListBas
Scene *scene= cob->scene;
bCameraSolverConstraint *data= con->data;
MovieClip *clip= data->clip;
-
- if(data->flag&CAMERASOLVER_ACTIVECLIP)
+
+ if (data->flag & CAMERASOLVER_ACTIVECLIP)
clip= scene->clip;
-
- if(clip) {
+
+ if (clip) {
float mat[4][4], obmat[4][4];
-
+
BKE_tracking_get_interpolated_camera(&clip->tracking, scene->r.cfra, mat);
-
+
copy_m4_m4(obmat, cob->matrix);
mul_m4_m4m4(cob->matrix, mat, obmat);
}
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index d7cc5376e21..9cbed451c09 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2009,7 +2009,7 @@ void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData
void CustomData_bmesh_init_pool(CustomData *data, int allocsize){
- if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, 0);
+ if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, FALSE, FALSE);
}
void CustomData_bmesh_free_block(CustomData *data, void **block)
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 40421c25607..36ae764198a 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -98,7 +98,8 @@ static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
/* paint effect default movement per frame in global units */
#define EFF_MOVEMENT_PER_FRAME 0.05f
/* initial wave time factor */
-#define WAVE_TIME_FAC 0.1
+#define WAVE_TIME_FAC (1.0f/24.f)
+#define WAVE_INIT_SIZE 5.0f
/* drying limits */
#define MIN_WETNESS 0.001f
/* dissolve macro */
@@ -149,6 +150,7 @@ typedef struct PaintBakeData {
int *s_num; /* num of realCoord samples */
Vec3f *realCoord; /* current pixel center world-space coordinates for each sample
* ordered as (s_pos+s_num)*/
+ Bounds3D mesh_bounds;
/* adjacency info */
BakeNeighPoint *bNeighs; /* current global neighbour distances and directions, if required */
@@ -207,7 +209,7 @@ typedef struct PaintAdjData {
static int setError(DynamicPaintCanvasSettings *canvas, const char *string)
{
/* Add error to canvas ui info label */
- BLI_snprintf(canvas->error, sizeof(canvas->error), string);
+ BLI_strncpy(canvas->error, string, sizeof(canvas->error));
return 0;
}
@@ -279,13 +281,13 @@ static void dynamicPaint_setPreview(DynamicPaintSurface *t_surface)
}
}
-int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object *ob, int index)
+int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object *ob, int output)
{
char *name;
- if (index == 0)
+ if (output == 0)
name = surface->output_name;
- else if (index == 1)
+ else if (output == 1)
name = surface->output_name2;
else
return 0;
@@ -317,7 +319,7 @@ static int surface_duplicateOutputExists(void *arg, const char *name)
return 0;
}
-void surface_setUniqueOutputName(DynamicPaintSurface *surface, char *basename, int output)
+static void surface_setUniqueOutputName(DynamicPaintSurface *surface, char *basename, int output)
{
char name[64];
BLI_strncpy(name, basename, sizeof(name)); /* in case basename is surface->name use a copy */
@@ -969,13 +971,13 @@ struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSett
surface->color_spread_speed = 1.0f;
surface->shrink_speed = 1.0f;
- surface->wave_damping = 0.05f;
+ surface->wave_damping = 0.04f;
surface->wave_speed = 1.0f;
surface->wave_timescale = 1.0f;
surface->wave_spring = 0.20f;
- BLI_snprintf(surface->image_output_path, sizeof(surface->image_output_path), "%sdynamicpaint", U.textudir);
- BLI_cleanup_dir(NULL, surface->image_output_path);
+ modifier_path_init(surface->image_output_path, sizeof(surface->image_output_path), "dynamicpaint");
+
dynamicPaintSurface_setUniqueName(surface, "Surface");
surface->effector_weights = BKE_add_effector_weights(NULL);
@@ -1037,6 +1039,7 @@ int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, stru
brush->particle_radius = 0.2f;
brush->particle_smooth = 0.05f;
+ brush->wave_type = MOD_DPAINT_WAVEB_CHANGE;
brush->wave_factor = 1.0f;
brush->wave_clamp = 0.0f;
brush->smudge_strength = 0.3f;
@@ -1472,11 +1475,12 @@ int dynamicPaint_resetSurface(DynamicPaintSurface *surface)
}
/* make sure allocated surface size matches current requirements */
-static void dynamicPaint_checkSurfaceData(DynamicPaintSurface *surface)
+static int dynamicPaint_checkSurfaceData(DynamicPaintSurface *surface)
{
if (!surface->data || ((dynamicPaint_surfaceNumOfPoints(surface) != surface->data->total_points))) {
- dynamicPaint_resetSurface(surface);
+ return dynamicPaint_resetSurface(surface);
}
+ return 1;
}
@@ -1611,6 +1615,10 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
/* paint layer */
col = CustomData_get_layer_named(&result->faceData, CD_MCOL, surface->output_name);
+ /* if output layer is lost from a constructive modifier, re-add it */
+ if (!col && dynamicPaint_outputLayerExists(surface, ob, 0))
+ col = CustomData_add_layer_named(&result->faceData, CD_MCOL, CD_CALLOC, NULL, numOfFaces, surface->output_name);
+ /* apply color */
if (col) {
#pragma omp parallel for schedule(static)
for (i=0; i<numOfFaces; i++) {
@@ -1631,6 +1639,10 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
/* wet layer */
col = CustomData_get_layer_named(&result->faceData, CD_MCOL, surface->output_name2);
+ /* if output layer is lost from a constructive modifier, re-add it */
+ if (!col && dynamicPaint_outputLayerExists(surface, ob, 1))
+ col = CustomData_add_layer_named(&result->faceData, CD_MCOL, CD_CALLOC, NULL, numOfFaces, surface->output_name2);
+ /* apply color */
if (col) {
#pragma omp parallel for schedule(static)
for (i=0; i<numOfFaces; i++) {
@@ -1789,7 +1801,7 @@ static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, Scene *scene
if (!(surface->flags & MOD_DPAINT_ACTIVE)) continue;
/* make sure surface is valid */
- dynamicPaint_checkSurfaceData(surface);
+ if (!dynamicPaint_checkSurfaceData(surface)) continue;
/* limit frame range */
CLAMP(current_frame, surface->start_frame, surface->end_frame);
@@ -1919,7 +1931,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
/* Get closest edge to that subpixel on UV map */
{
float pixel[2], dist, t_dist;
- int i, uindex[2], edge1_index, edge2_index,
+ int i, uindex[3], edge1_index, edge2_index,
e1_index, e2_index, target_face;
float closest_point[2], lambda, dir_vec[2];
int target_uv1, target_uv2, final_pixel[2], final_index;
@@ -2070,7 +2082,6 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
PaintUVPoint *tempPoints = NULL;
Vec3f *tempWeights = NULL;
- /* MVert *mvert = NULL; */ /* UNUSED */
MFace *mface = NULL;
MTFace *tface = NULL;
Bounds2D *faceBB = NULL;
@@ -2081,7 +2092,6 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) return setError(canvas, "Can't bake non-\"image sequence\" formats.");
numOfFaces = dm->getNumFaces(dm);
- /* mvert = dm->getVertArray(dm); */ /* UNUSED */
mface = dm->getFaceArray(dm);
/* get uv layer */
@@ -2859,7 +2869,12 @@ static void dynamicPaint_mixPaintColors(DynamicPaintSurface *surface, int index,
/* applies given brush intersection value for wave surface */
static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, DynamicPaintBrushSettings *brush, float isect_height)
{
+ float isect_change = isect_height - wPoint->brush_isect;
int hit = 0;
+ /* intersection marked regardless of brush type or hit */
+ wPoint->brush_isect = isect_height;
+ wPoint->state = DPAINT_WAVE_ISECT_CHANGED;
+
isect_height *= brush->wave_factor;
/* determine hit depending on wave_factor */
@@ -2878,6 +2893,10 @@ static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, DynamicPaintBrush
wPoint->velocity = isect_height;
else if (brush->wave_type == MOD_DPAINT_WAVEB_REFLECT)
wPoint->state = DPAINT_WAVE_REFLECT_ONLY;
+ else if (brush->wave_type == MOD_DPAINT_WAVEB_CHANGE) {
+ if (isect_change < 0.0f)
+ wPoint->height += isect_change*brush->wave_factor;
+ }
}
}
@@ -3235,7 +3254,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
/* Also cast a ray in opposite direction to make sure
* point is at least surrounded by two brush faces */
- mul_v3_fl(ray_dir, -1.0f);
+ negate_v3(ray_dir);
hit.index = -1;
hit.dist = 9999;
@@ -3386,7 +3405,8 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
velocity_val = len_v3(velocity);
/* if brush has smudge enabled store brush velocity */
- if (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
+ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT &&
+ brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
copy_v3_v3(&bData->brush_velocity[index*4], velocity);
mul_v3_fl(&bData->brush_velocity[index*4], 1.0f/velocity_val);
bData->brush_velocity[index*4+3] = velocity_val;
@@ -3680,7 +3700,8 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
velocity_val = len_v3(velocity);
/* store brush velocity for smudge */
- if (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
+ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT &&
+ brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
copy_v3_v3(&bData->brush_velocity[index*4], velocity);
mul_v3_fl(&bData->brush_velocity[index*4], 1.0f/velocity_val);
bData->brush_velocity[index*4+3] = velocity_val;
@@ -3778,7 +3799,8 @@ static int dynamicPaint_paintSinglePoint(DynamicPaintSurface *surface, float *po
velocity_val = len_v3(velocity);
/* store brush velocity for smudge */
- if (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
+ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT &&
+ brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
copy_v3_v3(&bData->brush_velocity[index*4], velocity);
mul_v3_fl(&bData->brush_velocity[index*4], 1.0f/velocity_val);
bData->brush_velocity[index*4+3] = velocity_val;
@@ -4139,13 +4161,13 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
totalAlpha += ePoint->e_alpha;
/* do color mixing */
- if (color_mix) mixColors(pPoint->e_color, pPoint->e_alpha, ePoint->e_color, color_mix);
+ if (color_mix > MIN_WETNESS) mixColors(pPoint->e_color, pPoint->e_alpha, ePoint->e_color, color_mix);
/* Check if neighbouring point has higher wetness,
* if so, add it's wetness to this point as well*/
if (ePoint->wetness <= pPoint->wetness) continue;
w_factor = ePoint->wetness/numOfNeighs * (ePoint->wetness - pPoint->wetness) * speed_scale;
- if (w_factor <= 0.0f) continue;
+ if (w_factor <= MIN_WETNESS) continue;
if (ePoint->e_alpha > pPoint->e_alpha) {
alphaAdd = ePoint->e_alpha/numOfNeighs * (ePoint->wetness*ePoint->e_alpha - pPoint->wetness*pPoint->e_alpha) * speed_scale;
@@ -4292,6 +4314,9 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
float dt, min_dist, damp_factor;
float wave_speed = surface->wave_speed;
double average_dist = 0.0f;
+ Bounds3D *mb = &sData->bData->mesh_bounds;
+ float canvas_size = MAX3((mb->max[0]-mb->min[0]), (mb->max[1]-mb->min[1]), (mb->max[2]-mb->min[2]));
+ float wave_scale = WAVE_INIT_SIZE/canvas_size;
/* allocate memory */
PaintWavePoint *prevPoint = MEM_mallocN(sData->total_points*sizeof(PaintWavePoint), "Temp previous points for wave simulation");
@@ -4307,11 +4332,11 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
average_dist += bNeighs[sData->adj_data->n_index[index]+i].dist;
}
}
- average_dist /= sData->adj_data->total_targets;
+ average_dist *= wave_scale/sData->adj_data->total_targets;
/* determine number of required steps */
steps = (int)ceil((WAVE_TIME_FAC*timescale*surface->wave_timescale) / (average_dist/wave_speed/3));
- CLAMP(steps, 1, 15);
+ CLAMP(steps, 1, 20);
timescale /= steps;
/* apply simulation values for final timescale */
@@ -4332,12 +4357,12 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
int numOfN = 0, numOfRN = 0;
int i;
- if (wPoint->state) continue;
+ if (wPoint->state > 0) continue;
/* calculate force from surrounding points */
for (i=0; i<numOfNeighs; i++) {
int n_index = sData->adj_data->n_index[index]+i;
- float dist = bNeighs[n_index].dist;
+ float dist = bNeighs[n_index].dist*wave_scale;
PaintWavePoint *tPoint = &prevPoint[sData->adj_data->n_target[n_index]];
if (!dist || tPoint->state>0) continue;
@@ -4381,6 +4406,10 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
#pragma omp parallel for schedule(static)
for (index = 0; index < sData->total_points; index++) {
PaintWavePoint *wPoint = &((PaintWavePoint*)sData->type_data)[index];
+ /* if there wasnt any brush intersection, clear isect height */
+ if (wPoint->state == DPAINT_WAVE_NONE) {
+ wPoint->brush_isect = 0.0f;
+ }
wPoint->state = DPAINT_WAVE_NONE;
}
@@ -4594,10 +4623,11 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
/*
* Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
*/
- #pragma omp parallel for schedule(static)
+ bData->mesh_bounds.valid = 0;
for (index=0; index<canvasNumOfVerts; index++) {
copy_v3_v3(canvas_verts[index].v, mvert[index].co);
mul_m4_v3(ob->obmat, canvas_verts[index].v);
+ boundInsert(&bData->mesh_bounds, canvas_verts[index].v);
}
/*
@@ -4784,7 +4814,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
BrushMaterials bMats = {0};
/* calculate brush speed vectors if required */
- if (brush->flags & MOD_DPAINT_DO_SMUDGE) {
+ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE) {
bData->brush_velocity = MEM_callocN(sData->total_points*sizeof(float)*4, "Dynamic Paint brush velocity");
/* init adjacency data if not already */
if (!sData->adj_data)
@@ -4834,7 +4864,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
/* process special brush effects, like smudge */
if (bData->brush_velocity) {
- if (brush->flags & MOD_DPAINT_DO_SMUDGE)
+ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE)
dynamicPaint_doSmudge(surface, brush, timescale);
MEM_freeN(bData->brush_velocity);
bData->brush_velocity = NULL;
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 5ab997d2c54..d01e3de0796 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1576,7 +1576,7 @@ float driver_get_variable_value (ChannelDriver *driver, DriverVar *dvar)
* - "evaltime" is the frame at which F-Curve is being evaluated
* - has to return a float value
*/
-static float evaluate_driver (ChannelDriver *driver, float UNUSED(evaltime))
+static float evaluate_driver (ChannelDriver *driver, const float evaltime)
{
DriverVar *dvar;
@@ -1663,8 +1663,10 @@ static float evaluate_driver (ChannelDriver *driver, float UNUSED(evaltime))
/* this evaluates the expression using Python,and returns its result:
* - on errors it reports, then returns 0.0f
*/
- driver->curval= BPY_driver_exec(driver);
+ driver->curval= BPY_driver_exec(driver, evaltime);
}
+#else /* WITH_PYTHON*/
+ (void)evaltime;
#endif /* WITH_PYTHON*/
}
break;
@@ -1705,8 +1707,8 @@ void correct_bezpart (float *v1, float *v2, float *v3, float *v4)
* - len2 = length of handle of end key
*/
len= v4[0]- v1[0];
- len1= (float)fabs(h1[0]);
- len2= (float)fabs(h2[0]);
+ len1= fabsf(h1[0]);
+ len2= fabsf(h2[0]);
/* if the handles have no length, no need to do any corrections */
if ((len1+len2) == 0.0f)
@@ -2087,7 +2089,7 @@ static float fcurve_eval_samples (FCurve *fcu, FPoint *fpts, float evaltime)
/* Evaluate and return the value of the given F-Curve at the specified frame ("evaltime")
* Note: this is also used for drivers
*/
-float evaluate_fcurve (FCurve *fcu, float evaltime)
+float evaluate_fcurve (FCurve *fcu, float evaltime)
{
float cvalue= 0.0f;
float devaltime;
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index ac4b936cb41..a44957ddc01 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -40,8 +40,6 @@
#include "MEM_guardedalloc.h"
-#define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b))
-
/* IDPropertyTemplate is a union in DNA_ID.h */
/*local size table.*/
@@ -193,7 +191,7 @@ static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
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");
+ array[a]= IDP_New(IDP_GROUP, &val, "IDP_ResizeArray group");
}
}
else {
@@ -349,17 +347,20 @@ static IDProperty *IDP_CopyString(IDProperty *prop)
void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
{
- int stlen;
-
- stlen = strlen(st);
+ int stlen = strlen(st);
if(maxlen > 0 && maxlen < stlen)
stlen= maxlen;
- stlen++; /* make room for null byte */
-
- IDP_ResizeArray(prop, stlen);
- BLI_strncpy(prop->data.pointer, st, stlen);
+ if (prop->subtype == IDP_STRING_SUB_BYTE) {
+ IDP_ResizeArray(prop, stlen);
+ memcpy(prop->data.pointer, st, stlen);
+ }
+ else {
+ stlen++; /* make room for null byte */
+ IDP_ResizeArray(prop, stlen);
+ BLI_strncpy(prop->data.pointer, st, stlen);
+ }
}
void IDP_ConcatStringC(IDProperty *prop, const char *st)
@@ -461,7 +462,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
IDProperty *loop, *prop;
for (prop=src->data.group.first; prop; prop=prop->next) {
for (loop=dest->data.group.first; loop; loop=loop->next) {
- if (BSTR_EQ(loop->name, prop->name)) {
+ if (strcmp(loop->name, prop->name) == 0) {
IDProperty *copy = IDP_CopyProperty(prop);
BLI_insertlink(&dest->data.group, loop, copy);
@@ -632,7 +633,7 @@ int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
else if(prop1->type == IDP_DOUBLE)
return (IDP_Double(prop1) == IDP_Double(prop2));
else if(prop1->type == IDP_STRING)
- return BSTR_EQ(IDP_String(prop1), IDP_String(prop2));
+ 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)
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype]*prop1->len);
@@ -670,32 +671,33 @@ int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
return 1;
}
-IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name)
+/* 'val' is never NULL, dont check */
+IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name)
{
IDProperty *prop=NULL;
switch (type) {
case IDP_INT:
prop = MEM_callocN(sizeof(IDProperty), "IDProperty int");
- prop->data.val = val.i;
+ prop->data.val = val->i;
break;
case IDP_FLOAT:
prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
- *(float*)&prop->data.val = val.f;
+ *(float*)&prop->data.val = val->f;
break;
case IDP_DOUBLE:
prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
- *(double*)&prop->data.val = val.d;
+ *(double*)&prop->data.val = val->d;
break;
case IDP_ARRAY:
{
/*for now, we only support float and int and double arrays*/
- if (val.array.type == IDP_FLOAT || val.array.type == IDP_INT || val.array.type == IDP_DOUBLE || val.array.type == IDP_GROUP) {
+ if (val->array.type == IDP_FLOAT || val->array.type == IDP_INT || val->array.type == IDP_DOUBLE || val->array.type == IDP_GROUP) {
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
- prop->subtype = val.array.type;
- if (val.array.len)
- prop->data.pointer = MEM_callocN(idp_size_table[val.array.type]*val.array.len, "id property array");
- prop->len = prop->totallen = val.array.len;
+ prop->subtype = val->array.type;
+ if (val->array.len)
+ 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 {
return NULL;
@@ -703,18 +705,36 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name)
}
case IDP_STRING:
{
- char *st = val.str;
+ const char *st = val->string.str;
prop = MEM_callocN(sizeof(IDProperty), "IDProperty string");
- if (st == NULL) {
- prop->data.pointer = MEM_callocN(DEFAULT_ALLOC_FOR_NULL_STRINGS, "id property string 1");
- prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
- prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
- } else {
- int stlen = strlen(st) + 1;
- prop->data.pointer = MEM_mallocN(stlen, "id property string 2");
- prop->len = prop->totallen = stlen;
- memcpy(prop->data.pointer, st, stlen);
+ if (val->string.subtype == IDP_STRING_SUB_BYTE) {
+ /* note, intentionally not null terminated */
+ if (st == NULL) {
+ prop->data.pointer = MEM_callocN(DEFAULT_ALLOC_FOR_NULL_STRINGS, "id property string 1");
+ prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
+ prop->len = 0;
+ }
+ else {
+ prop->data.pointer = MEM_mallocN(val->string.len, "id property string 2");
+ prop->len = prop->totallen = val->string.len;
+ memcpy(prop->data.pointer, st, val->string.len);
+ }
+ prop->subtype= IDP_STRING_SUB_BYTE;
+ }
+ else {
+ if (st == NULL) {
+ prop->data.pointer = MEM_callocN(DEFAULT_ALLOC_FOR_NULL_STRINGS, "id property string 1");
+ prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
+ prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
+ }
+ else {
+ int stlen = strlen(st) + 1;
+ prop->data.pointer = MEM_mallocN(stlen, "id property string 3");
+ prop->len = prop->totallen = stlen;
+ memcpy(prop->data.pointer, st, stlen);
+ }
+ prop->subtype= IDP_STRING_SUB_UTF8;
}
break;
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 08440849a4e..a61ae705020 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1484,11 +1484,11 @@ int BKE_write_ibuf_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, const
}
-void BKE_makepicstring(char *string, const char *base, int frame, int imtype, const short use_ext, const short use_frames)
+void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, int imtype, const short use_ext, const short use_frames)
{
if (string==NULL) return;
BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */
- BLI_path_abs(string, G.main->name);
+ BLI_path_abs(string, relbase);
if(use_frames)
BLI_path_frame(string, frame, 4);
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index df3694e0bf1..00a2de369a3 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -1814,7 +1814,7 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float
/*compute forces*/
sub_v3_v3v3(vec, cos[i], cv->tx);
- mul_v3_fl(vec, cv->mass*dt*20.0);
+ mul_v3_fl(vec, cv->mass*dt*20.0f);
add_v3_v3(cv->tv, vec);
//copy_v3_v3(cv->tx, cos[i]);
}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index d8628e526ef..3e3f16dcfa3 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -1781,11 +1781,11 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
calc_mballco(mainb[a], vec);
- size= (float)fabs( vec[0] );
+ size= fabsf( vec[0] );
if( size > totsize ) totsize= size;
- size= (float)fabs( vec[1] );
+ size= fabsf( vec[1] );
if( size > totsize ) totsize= size;
- size= (float)fabs( vec[2] );
+ size= fabsf( vec[2] );
if( size > totsize ) totsize= size;
vec[0]= mainb[a]->x - mainb[a]->rad;
@@ -1794,11 +1794,11 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
calc_mballco(mainb[a], vec);
- size= (float)fabs( vec[0] );
+ size= fabsf( vec[0] );
if( size > totsize ) totsize= size;
- size= (float)fabs( vec[1] );
+ size= fabsf( vec[1] );
if( size > totsize ) totsize= size;
- size= (float)fabs( vec[2] );
+ size= fabsf( vec[2] );
if( size > totsize ) totsize= size;
}
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 0dac4b8cd80..ec24f72874d 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -331,7 +331,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
#undef PRINT
-int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata, CustomData *fdata, short do_verbose, const short do_fixes)
+static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata, CustomData *fdata, short do_verbose, const short do_fixes)
{
int vfixed= 0, efixed= 0, ffixed= 0;
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index bbc1b596889..f09be8c34ad 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -60,6 +60,11 @@
#include "BKE_key.h"
#include "BKE_multires.h"
+/* may move these, only for modifier_path_relbase */
+#include "BKE_global.h" /* ugh, G.main->name only */
+#include "BKE_main.h"
+/* end */
+
#include "MOD_modifiertypes.h"
ModifierTypeInfo *modifierType_getInfo(ModifierType type)
@@ -573,3 +578,36 @@ void test_object_modifiers(Object *ob)
}
}
}
+
+/* where should this go?, it doesnt fit well anywhere :S - campbell */
+
+/* elubie: changed this to default to the same dir as the render output
+ * to prevent saving to C:\ on Windows */
+
+/* campbell: logic behind this...
+ *
+ * - 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.
+ */
+const char *modifier_path_relbase(Object *ob)
+{
+ if (G.relbase_valid || ob->id.lib) {
+ return ID_BLEND_PATH(G.main, &ob->id);
+ }
+ else {
+ /* last resort, better then using "" which resolves to the current
+ * working directory */
+ return BLI_temporary_dir();
+ }
+}
+
+/* initializes the path with either */
+void modifier_path_init(char *path, int path_maxlen, const char *name)
+{
+ /* elubie: changed this to default to the same dir as the render output
+ * to prevent saving to C:\ on Windows */
+ BLI_join_dirfile(path, path_maxlen,
+ G.relbase_valid ? "//" : BLI_temporary_dir(),
+ name);
+}
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 8a908097862..fd184b9def4 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -400,7 +400,7 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short
/* scaling */
if (IS_EQF(strip->scale, 0.0f)) strip->scale= 1.0f;
- scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */
+ scale = fabsf(strip->scale); /* scale must be positive - we've got a special flag for reversing */
/* length of referenced action */
actlength = strip->actend - strip->actstart;
@@ -1087,7 +1087,7 @@ void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip)
short BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max)
{
const float stripLen= (strip) ? strip->end - strip->start : 0.0f;
- const float boundsLen= (float)fabs(max - min);
+ const float boundsLen= fabsf(max - min);
/* sanity checks */
if ((strip == NULL) || IS_EQF(stripLen, 0.0f) || IS_EQF(boundsLen, 0.0f))
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index c4edddf587c..7be6ef9968d 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1643,15 +1643,22 @@ struct bNodeTemplate nodeMakeTemplate(struct bNode *node)
}
}
-void node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
+void node_type_base(bNodeTreeType *ttype, bNodeType *ntype, int type, const char *name, short nclass, short flag)
{
memset(ntype, 0, sizeof(bNodeType));
-
+
ntype->type = type;
BLI_strncpy(ntype->name, name, sizeof(ntype->name));
ntype->nclass = nclass;
ntype->flag = flag;
-
+
+ /* Default muting stuff. */
+ if(ttype) {
+ ntype->mutefunc = ttype->mutefunc;
+ ntype->mutelinksfunc = ttype->mutelinksfunc;
+ ntype->gpumutefunc = ttype->gpumutefunc;
+ }
+
/* default size values */
ntype->width = 140;
ntype->minwidth = 100;
@@ -1746,6 +1753,16 @@ void node_type_exec_new(struct bNodeType *ntype,
ntype->newexecfunc = newexecfunc;
}
+void node_type_mute(struct bNodeType *ntype,
+ void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata,
+ struct bNodeStack **, struct bNodeStack **),
+ ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
+ struct GPUNodeStack *, struct GPUNodeStack *))
+{
+ ntype->mutefunc = mutefunc;
+ ntype->mutelinksfunc = mutelinksfunc;
+}
+
void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out))
{
ntype->gpufunc = gpufunc;
@@ -1756,6 +1773,12 @@ void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMate
ntype->gpuextfunc = gpuextfunc;
}
+void node_type_gpu_mute(struct bNodeType *ntype, int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *,
+ struct GPUNodeStack *, struct GPUNodeStack *))
+{
+ ntype->gpumutefunc = gpumutefunc;
+}
+
void node_type_compatibility(struct bNodeType *ntype, short compatibility)
{
ntype->compatibility = compatibility;
@@ -1772,211 +1795,212 @@ static bNodeType *is_nodetype_registered(ListBase *typelist, int type)
return NULL;
}
-void nodeRegisterType(ListBase *typelist, bNodeType *ntype)
+void nodeRegisterType(bNodeTreeType *ttype, bNodeType *ntype)
{
+ ListBase *typelist = &(ttype->node_types);
bNodeType *found= is_nodetype_registered(typelist, ntype->type);
if(found==NULL)
BLI_addtail(typelist, ntype);
}
-static void registerCompositNodes(ListBase *ntypelist)
-{
- register_node_type_frame(ntypelist);
-
- register_node_type_cmp_group(ntypelist);
-// register_node_type_cmp_forloop(ntypelist);
-// register_node_type_cmp_whileloop(ntypelist);
-
- register_node_type_cmp_rlayers(ntypelist);
- register_node_type_cmp_image(ntypelist);
- register_node_type_cmp_texture(ntypelist);
- register_node_type_cmp_value(ntypelist);
- register_node_type_cmp_rgb(ntypelist);
- register_node_type_cmp_curve_time(ntypelist);
- register_node_type_cmp_movieclip(ntypelist);
-
- register_node_type_cmp_composite(ntypelist);
- register_node_type_cmp_viewer(ntypelist);
- register_node_type_cmp_splitviewer(ntypelist);
- register_node_type_cmp_output_file(ntypelist);
- register_node_type_cmp_view_levels(ntypelist);
-
- register_node_type_cmp_curve_rgb(ntypelist);
- register_node_type_cmp_mix_rgb(ntypelist);
- register_node_type_cmp_hue_sat(ntypelist);
- register_node_type_cmp_brightcontrast(ntypelist);
- register_node_type_cmp_gamma(ntypelist);
- register_node_type_cmp_invert(ntypelist);
- register_node_type_cmp_alphaover(ntypelist);
- register_node_type_cmp_zcombine(ntypelist);
- register_node_type_cmp_colorbalance(ntypelist);
- register_node_type_cmp_huecorrect(ntypelist);
-
- register_node_type_cmp_normal(ntypelist);
- register_node_type_cmp_curve_vec(ntypelist);
- register_node_type_cmp_map_value(ntypelist);
- register_node_type_cmp_normalize(ntypelist);
-
- register_node_type_cmp_filter(ntypelist);
- register_node_type_cmp_blur(ntypelist);
- register_node_type_cmp_dblur(ntypelist);
- register_node_type_cmp_bilateralblur(ntypelist);
- register_node_type_cmp_vecblur(ntypelist);
- register_node_type_cmp_dilateerode(ntypelist);
- register_node_type_cmp_defocus(ntypelist);
-
- register_node_type_cmp_valtorgb(ntypelist);
- register_node_type_cmp_rgbtobw(ntypelist);
- register_node_type_cmp_setalpha(ntypelist);
- register_node_type_cmp_idmask(ntypelist);
- register_node_type_cmp_math(ntypelist);
- register_node_type_cmp_seprgba(ntypelist);
- register_node_type_cmp_combrgba(ntypelist);
- register_node_type_cmp_sephsva(ntypelist);
- register_node_type_cmp_combhsva(ntypelist);
- register_node_type_cmp_sepyuva(ntypelist);
- register_node_type_cmp_combyuva(ntypelist);
- register_node_type_cmp_sepycca(ntypelist);
- register_node_type_cmp_combycca(ntypelist);
- register_node_type_cmp_premulkey(ntypelist);
-
- register_node_type_cmp_diff_matte(ntypelist);
- register_node_type_cmp_distance_matte(ntypelist);
- register_node_type_cmp_chroma_matte(ntypelist);
- register_node_type_cmp_color_matte(ntypelist);
- register_node_type_cmp_channel_matte(ntypelist);
- register_node_type_cmp_color_spill(ntypelist);
- register_node_type_cmp_luma_matte(ntypelist);
-
- register_node_type_cmp_translate(ntypelist);
- register_node_type_cmp_rotate(ntypelist);
- register_node_type_cmp_scale(ntypelist);
- register_node_type_cmp_flip(ntypelist);
- register_node_type_cmp_crop(ntypelist);
- register_node_type_cmp_displace(ntypelist);
- register_node_type_cmp_mapuv(ntypelist);
- register_node_type_cmp_glare(ntypelist);
- register_node_type_cmp_tonemap(ntypelist);
- register_node_type_cmp_lensdist(ntypelist);
- register_node_type_cmp_transform(ntypelist);
- register_node_type_cmp_stabilize2d(ntypelist);
- register_node_type_cmp_moviedistortion(ntypelist);
-}
-
-static void registerShaderNodes(ListBase *ntypelist)
-{
- register_node_type_frame(ntypelist);
-
- register_node_type_sh_group(ntypelist);
- //register_node_type_sh_forloop(ntypelist);
- //register_node_type_sh_whileloop(ntypelist);
-
- register_node_type_sh_output(ntypelist);
- register_node_type_sh_material(ntypelist);
- register_node_type_sh_camera(ntypelist);
- register_node_type_sh_value(ntypelist);
- register_node_type_sh_rgb(ntypelist);
- register_node_type_sh_mix_rgb(ntypelist);
- register_node_type_sh_valtorgb(ntypelist);
- register_node_type_sh_rgbtobw(ntypelist);
- register_node_type_sh_texture(ntypelist);
- register_node_type_sh_normal(ntypelist);
- register_node_type_sh_geom(ntypelist);
- register_node_type_sh_mapping(ntypelist);
- register_node_type_sh_curve_vec(ntypelist);
- register_node_type_sh_curve_rgb(ntypelist);
- register_node_type_sh_math(ntypelist);
- register_node_type_sh_vect_math(ntypelist);
- register_node_type_sh_squeeze(ntypelist);
- //register_node_type_sh_dynamic(ntypelist);
- register_node_type_sh_material_ext(ntypelist);
- register_node_type_sh_invert(ntypelist);
- register_node_type_sh_seprgb(ntypelist);
- register_node_type_sh_combrgb(ntypelist);
- register_node_type_sh_hue_sat(ntypelist);
-
- register_node_type_sh_attribute(ntypelist);
- register_node_type_sh_geometry(ntypelist);
- register_node_type_sh_light_path(ntypelist);
- register_node_type_sh_fresnel(ntypelist);
- register_node_type_sh_layer_weight(ntypelist);
- register_node_type_sh_tex_coord(ntypelist);
-
- register_node_type_sh_background(ntypelist);
- register_node_type_sh_bsdf_diffuse(ntypelist);
- register_node_type_sh_bsdf_glossy(ntypelist);
- register_node_type_sh_bsdf_glass(ntypelist);
- register_node_type_sh_bsdf_translucent(ntypelist);
- register_node_type_sh_bsdf_transparent(ntypelist);
- register_node_type_sh_bsdf_velvet(ntypelist);
- register_node_type_sh_emission(ntypelist);
- register_node_type_sh_holdout(ntypelist);
- //register_node_type_sh_volume_transparent(ntypelist);
- //register_node_type_sh_volume_isotropic(ntypelist);
- register_node_type_sh_mix_shader(ntypelist);
- register_node_type_sh_add_shader(ntypelist);
-
- register_node_type_sh_output_lamp(ntypelist);
- register_node_type_sh_output_material(ntypelist);
- register_node_type_sh_output_world(ntypelist);
-
- register_node_type_sh_tex_image(ntypelist);
- register_node_type_sh_tex_environment(ntypelist);
- register_node_type_sh_tex_sky(ntypelist);
- register_node_type_sh_tex_noise(ntypelist);
- register_node_type_sh_tex_wave(ntypelist);
- register_node_type_sh_tex_voronoi(ntypelist);
- register_node_type_sh_tex_musgrave(ntypelist);
- register_node_type_sh_tex_gradient(ntypelist);
- register_node_type_sh_tex_magic(ntypelist);
-}
-
-static void registerTextureNodes(ListBase *ntypelist)
-{
- register_node_type_frame(ntypelist);
-
- register_node_type_tex_group(ntypelist);
-// register_node_type_tex_forloop(ntypelist);
-// register_node_type_tex_whileloop(ntypelist);
-
- register_node_type_tex_math(ntypelist);
- register_node_type_tex_mix_rgb(ntypelist);
- register_node_type_tex_valtorgb(ntypelist);
- register_node_type_tex_rgbtobw(ntypelist);
- register_node_type_tex_valtonor(ntypelist);
- register_node_type_tex_curve_rgb(ntypelist);
- register_node_type_tex_curve_time(ntypelist);
- register_node_type_tex_invert(ntypelist);
- register_node_type_tex_hue_sat(ntypelist);
- register_node_type_tex_coord(ntypelist);
- register_node_type_tex_distance(ntypelist);
- register_node_type_tex_compose(ntypelist);
- register_node_type_tex_decompose(ntypelist);
-
- register_node_type_tex_output(ntypelist);
- register_node_type_tex_viewer(ntypelist);
-
- register_node_type_tex_checker(ntypelist);
- register_node_type_tex_texture(ntypelist);
- register_node_type_tex_bricks(ntypelist);
- register_node_type_tex_image(ntypelist);
-
- register_node_type_tex_rotate(ntypelist);
- register_node_type_tex_translate(ntypelist);
- register_node_type_tex_scale(ntypelist);
- register_node_type_tex_at(ntypelist);
-
- register_node_type_tex_proc_voronoi(ntypelist);
- register_node_type_tex_proc_blend(ntypelist);
- register_node_type_tex_proc_magic(ntypelist);
- register_node_type_tex_proc_marble(ntypelist);
- register_node_type_tex_proc_clouds(ntypelist);
- register_node_type_tex_proc_wood(ntypelist);
- register_node_type_tex_proc_musgrave(ntypelist);
- register_node_type_tex_proc_noise(ntypelist);
- register_node_type_tex_proc_stucci(ntypelist);
- register_node_type_tex_proc_distnoise(ntypelist);
+static void registerCompositNodes(bNodeTreeType *ttype)
+{
+ register_node_type_frame(ttype);
+
+ register_node_type_cmp_group(ttype);
+// register_node_type_cmp_forloop(ttype);
+// register_node_type_cmp_whileloop(ttype);
+
+ register_node_type_cmp_rlayers(ttype);
+ register_node_type_cmp_image(ttype);
+ register_node_type_cmp_texture(ttype);
+ register_node_type_cmp_value(ttype);
+ register_node_type_cmp_rgb(ttype);
+ register_node_type_cmp_curve_time(ttype);
+ register_node_type_cmp_movieclip(ttype);
+
+ register_node_type_cmp_composite(ttype);
+ register_node_type_cmp_viewer(ttype);
+ register_node_type_cmp_splitviewer(ttype);
+ register_node_type_cmp_output_file(ttype);
+ register_node_type_cmp_view_levels(ttype);
+
+ register_node_type_cmp_curve_rgb(ttype);
+ register_node_type_cmp_mix_rgb(ttype);
+ register_node_type_cmp_hue_sat(ttype);
+ register_node_type_cmp_brightcontrast(ttype);
+ register_node_type_cmp_gamma(ttype);
+ register_node_type_cmp_invert(ttype);
+ register_node_type_cmp_alphaover(ttype);
+ register_node_type_cmp_zcombine(ttype);
+ register_node_type_cmp_colorbalance(ttype);
+ register_node_type_cmp_huecorrect(ttype);
+
+ register_node_type_cmp_normal(ttype);
+ register_node_type_cmp_curve_vec(ttype);
+ register_node_type_cmp_map_value(ttype);
+ register_node_type_cmp_normalize(ttype);
+
+ register_node_type_cmp_filter(ttype);
+ register_node_type_cmp_blur(ttype);
+ register_node_type_cmp_dblur(ttype);
+ register_node_type_cmp_bilateralblur(ttype);
+ register_node_type_cmp_vecblur(ttype);
+ register_node_type_cmp_dilateerode(ttype);
+ register_node_type_cmp_defocus(ttype);
+
+ register_node_type_cmp_valtorgb(ttype);
+ register_node_type_cmp_rgbtobw(ttype);
+ register_node_type_cmp_setalpha(ttype);
+ register_node_type_cmp_idmask(ttype);
+ register_node_type_cmp_math(ttype);
+ register_node_type_cmp_seprgba(ttype);
+ register_node_type_cmp_combrgba(ttype);
+ register_node_type_cmp_sephsva(ttype);
+ register_node_type_cmp_combhsva(ttype);
+ register_node_type_cmp_sepyuva(ttype);
+ register_node_type_cmp_combyuva(ttype);
+ register_node_type_cmp_sepycca(ttype);
+ register_node_type_cmp_combycca(ttype);
+ register_node_type_cmp_premulkey(ttype);
+
+ register_node_type_cmp_diff_matte(ttype);
+ register_node_type_cmp_distance_matte(ttype);
+ register_node_type_cmp_chroma_matte(ttype);
+ register_node_type_cmp_color_matte(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_translate(ttype);
+ register_node_type_cmp_rotate(ttype);
+ register_node_type_cmp_scale(ttype);
+ register_node_type_cmp_flip(ttype);
+ register_node_type_cmp_crop(ttype);
+ register_node_type_cmp_displace(ttype);
+ register_node_type_cmp_mapuv(ttype);
+ register_node_type_cmp_glare(ttype);
+ register_node_type_cmp_tonemap(ttype);
+ register_node_type_cmp_lensdist(ttype);
+ register_node_type_cmp_transform(ttype);
+ register_node_type_cmp_stabilize2d(ttype);
+ register_node_type_cmp_moviedistortion(ttype);
+}
+
+static void registerShaderNodes(bNodeTreeType *ttype)
+{
+ register_node_type_frame(ttype);
+
+ register_node_type_sh_group(ttype);
+ //register_node_type_sh_forloop(ttype);
+ //register_node_type_sh_whileloop(ttype);
+
+ register_node_type_sh_output(ttype);
+ register_node_type_sh_material(ttype);
+ register_node_type_sh_camera(ttype);
+ register_node_type_sh_value(ttype);
+ register_node_type_sh_rgb(ttype);
+ register_node_type_sh_mix_rgb(ttype);
+ register_node_type_sh_valtorgb(ttype);
+ register_node_type_sh_rgbtobw(ttype);
+ register_node_type_sh_texture(ttype);
+ register_node_type_sh_normal(ttype);
+ register_node_type_sh_geom(ttype);
+ register_node_type_sh_mapping(ttype);
+ register_node_type_sh_curve_vec(ttype);
+ register_node_type_sh_curve_rgb(ttype);
+ register_node_type_sh_math(ttype);
+ register_node_type_sh_vect_math(ttype);
+ register_node_type_sh_squeeze(ttype);
+ //register_node_type_sh_dynamic(ttype);
+ register_node_type_sh_material_ext(ttype);
+ register_node_type_sh_invert(ttype);
+ register_node_type_sh_seprgb(ttype);
+ register_node_type_sh_combrgb(ttype);
+ register_node_type_sh_hue_sat(ttype);
+
+ register_node_type_sh_attribute(ttype);
+ register_node_type_sh_geometry(ttype);
+ register_node_type_sh_light_path(ttype);
+ register_node_type_sh_fresnel(ttype);
+ register_node_type_sh_layer_weight(ttype);
+ register_node_type_sh_tex_coord(ttype);
+
+ register_node_type_sh_background(ttype);
+ register_node_type_sh_bsdf_diffuse(ttype);
+ register_node_type_sh_bsdf_glossy(ttype);
+ register_node_type_sh_bsdf_glass(ttype);
+ register_node_type_sh_bsdf_translucent(ttype);
+ register_node_type_sh_bsdf_transparent(ttype);
+ register_node_type_sh_bsdf_velvet(ttype);
+ register_node_type_sh_emission(ttype);
+ register_node_type_sh_holdout(ttype);
+ //register_node_type_sh_volume_transparent(ttype);
+ //register_node_type_sh_volume_isotropic(ttype);
+ register_node_type_sh_mix_shader(ttype);
+ register_node_type_sh_add_shader(ttype);
+
+ register_node_type_sh_output_lamp(ttype);
+ register_node_type_sh_output_material(ttype);
+ register_node_type_sh_output_world(ttype);
+
+ register_node_type_sh_tex_image(ttype);
+ register_node_type_sh_tex_environment(ttype);
+ register_node_type_sh_tex_sky(ttype);
+ register_node_type_sh_tex_noise(ttype);
+ register_node_type_sh_tex_wave(ttype);
+ register_node_type_sh_tex_voronoi(ttype);
+ register_node_type_sh_tex_musgrave(ttype);
+ register_node_type_sh_tex_gradient(ttype);
+ register_node_type_sh_tex_magic(ttype);
+}
+
+static void registerTextureNodes(bNodeTreeType *ttype)
+{
+ register_node_type_frame(ttype);
+
+ register_node_type_tex_group(ttype);
+// register_node_type_tex_forloop(ttype);
+// register_node_type_tex_whileloop(ttype);
+
+ register_node_type_tex_math(ttype);
+ register_node_type_tex_mix_rgb(ttype);
+ register_node_type_tex_valtorgb(ttype);
+ register_node_type_tex_rgbtobw(ttype);
+ register_node_type_tex_valtonor(ttype);
+ register_node_type_tex_curve_rgb(ttype);
+ register_node_type_tex_curve_time(ttype);
+ register_node_type_tex_invert(ttype);
+ register_node_type_tex_hue_sat(ttype);
+ register_node_type_tex_coord(ttype);
+ register_node_type_tex_distance(ttype);
+ register_node_type_tex_compose(ttype);
+ register_node_type_tex_decompose(ttype);
+
+ register_node_type_tex_output(ttype);
+ register_node_type_tex_viewer(ttype);
+
+ register_node_type_tex_checker(ttype);
+ register_node_type_tex_texture(ttype);
+ register_node_type_tex_bricks(ttype);
+ register_node_type_tex_image(ttype);
+
+ register_node_type_tex_rotate(ttype);
+ register_node_type_tex_translate(ttype);
+ register_node_type_tex_scale(ttype);
+ register_node_type_tex_at(ttype);
+
+ register_node_type_tex_proc_voronoi(ttype);
+ register_node_type_tex_proc_blend(ttype);
+ register_node_type_tex_proc_magic(ttype);
+ register_node_type_tex_proc_marble(ttype);
+ register_node_type_tex_proc_clouds(ttype);
+ register_node_type_tex_proc_wood(ttype);
+ register_node_type_tex_proc_musgrave(ttype);
+ register_node_type_tex_proc_noise(ttype);
+ register_node_type_tex_proc_stucci(ttype);
+ register_node_type_tex_proc_distnoise(ttype);
}
static void free_dynamic_typeinfo(bNodeType *ntype)
@@ -2010,9 +2034,9 @@ static void free_typeinfos(ListBase *list)
void init_nodesystem(void)
{
- registerCompositNodes(&ntreeGetType(NTREE_COMPOSIT)->node_types);
- registerShaderNodes(&ntreeGetType(NTREE_SHADER)->node_types);
- registerTextureNodes(&ntreeGetType(NTREE_TEXTURE)->node_types);
+ registerCompositNodes(ntreeGetType(NTREE_COMPOSIT));
+ registerShaderNodes(ntreeGetType(NTREE_SHADER));
+ registerTextureNodes(ntreeGetType(NTREE_TEXTURE));
}
void free_nodesystem(void)
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index f3486360d08..b25c130590e 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -50,6 +50,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_sound_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
@@ -971,7 +972,6 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
void copy_object_particlesystems(Object *obn, Object *ob)
{
- ParticleSystemModifierData *psmd;
ParticleSystem *psys, *npsys;
ModifierData *md;
@@ -984,10 +984,28 @@ void copy_object_particlesystems(Object *obn, Object *ob)
/* need to update particle modifiers too */
for(md=obn->modifiers.first; md; md=md->next) {
if(md->type==eModifierType_ParticleSystem) {
- psmd= (ParticleSystemModifierData*)md;
+ ParticleSystemModifierData *psmd= (ParticleSystemModifierData*)md;
if(psmd->psys==psys)
psmd->psys= npsys;
}
+ else if(md->type==eModifierType_DynamicPaint) {
+ DynamicPaintModifierData *pmd= (DynamicPaintModifierData*)md;
+ if (pmd->brush) {
+ if(pmd->brush->psys==psys) {
+ pmd->brush->psys= npsys;
+ }
+ }
+ }
+ else if (md->type==eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ if(smd->type==MOD_SMOKE_TYPE_FLOW) {
+ if (smd->flow) {
+ if (smd->flow->psys == psys)
+ smd->flow->psys= npsys;
+ }
+ }
+ }
}
}
}
@@ -1879,13 +1897,6 @@ static void ob_parvert3(Object *ob, Object *par, float mat[][4])
}
}
-// XXX what the hell is this?
-static int no_parent_ipo=0;
-void set_no_parent_ipo(int val)
-{
- no_parent_ipo= val;
-}
-
static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[4][4])
{
float *fp1, *fp2;
@@ -1893,7 +1904,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
int a;
// include framerate
- fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) );
+ fac1= ( 1.0f / (1.0f + fabsf(ob->sf)) );
if(fac1 >= 1.0f) return 0;
fac2= 1.0f-fac1;
@@ -1925,7 +1936,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
/* hurms, code below conflicts with depgraph... (ton) */
/* and even worse, it gives bad effects for NLA stride too (try ctime != par->ctime, with MBlur) */
- if(no_parent_ipo==0 && stime != par->ctime) {
+ if(stime != par->ctime) {
// only for ipo systems?
Object tmp= *par;
@@ -2343,6 +2354,69 @@ int minmax_object_duplis(Scene *scene, Object *ob, float *min, float *max)
return ok;
}
+void BKE_object_foreach_display_point(
+ Object *ob, float obmat[4][4],
+ void (*func_cb)(const float[3], void *), void *user_data)
+{
+ float co[3];
+
+ if (ob->derivedFinal) {
+ DerivedMesh *dm= ob->derivedFinal;
+ MVert *mv= dm->getVertArray(dm);
+ int totvert= dm->getNumVerts(dm);
+ int i;
+
+ for (i= 0; i < totvert; i++, mv++) {
+ mul_v3_m4v3(co, obmat, mv->co);
+ func_cb(co, user_data);
+ }
+ }
+ else if (ob->disp.first) {
+ DispList *dl;
+
+ for (dl=ob->disp.first; dl; dl=dl->next) {
+ float *v3= dl->verts;
+ int totvert= dl->nr;
+ int i;
+
+ for (i= 0; i < totvert; i++, v3+=3) {
+ mul_v3_m4v3(co, obmat, v3);
+ func_cb(co, user_data);
+ }
+ }
+ }
+}
+
+void BKE_scene_foreach_display_point(
+ Scene *scene, View3D *v3d, const short flag,
+ void (*func_cb)(const float[3], void *), void *user_data)
+{
+ Base *base;
+ Object *ob;
+
+ for(base= FIRSTBASE; base; base = base->next) {
+ if(BASE_VISIBLE(v3d, base) && (base->flag & flag) == flag) {
+ ob= base->object;
+
+ if ((ob->transflag & OB_DUPLI)==0) {
+ BKE_object_foreach_display_point(ob, ob->obmat, func_cb, user_data);
+ }
+ else {
+ ListBase *lb;
+ DupliObject *dob;
+
+ lb= object_duplilist(scene, ob);
+ for(dob= lb->first; dob; dob= dob->next) {
+ if(dob->no_draw == 0) {
+ BKE_object_foreach_display_point(dob->ob, dob->mat, func_cb, user_data);
+ }
+ }
+ free_object_duplilist(lb); /* does restore */
+ }
+ }
+ }
+}
+
/* copied from DNA_object_types.h */
typedef struct ObTfmBack {
float loc[3], dloc[3], orig[3];
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
new file mode 100644
index 00000000000..85b9b0fbf22
--- /dev/null
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -0,0 +1,1425 @@
+/*
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: Matt Ebb, Hamed Zaghaghi
+ * Based on original code by Drew Whitehouse / Houdini Ocean Toolkit
+ * OpenMP hints by Christian Schnellhammer
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+#include <math.h>
+#include <stdlib.h>
+
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+
+#include "BKE_image.h"
+#include "BKE_ocean.h"
+#include "BKE_utildefines.h"
+
+#include "BKE_global.h" // XXX TESTING
+
+#include "BLI_math_base.h"
+#include "BLI_math_inline.h"
+#include "BLI_rand.h"
+#include "BLI_string.h"
+#include "BLI_threads.h"
+#include "BLI_path_util.h"
+#include "BLI_utildefines.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "RE_render_ext.h"
+
+#ifdef WITH_OCEANSIM
+
+// Ocean code
+#include "fftw3.h"
+
+#define GRAVITY 9.81f
+
+typedef struct Ocean {
+ /* ********* input parameters to the sim ********* */
+ float _V;
+ float _l;
+ float _w;
+ float _A;
+ float _damp_reflections;
+ float _wind_alignment;
+ float _depth;
+
+ float _wx;
+ float _wz;
+
+ float _L;
+
+ /* dimensions of computational grid */
+ int _M;
+ int _N;
+
+ /* spatial size of computational grid */
+ float _Lx;
+ float _Lz;
+
+ float normalize_factor; // init w
+ float time;
+
+ short _do_disp_y;
+ short _do_normals;
+ short _do_chop;
+ short _do_jacobian;
+
+ /* mutex for threaded texture access */
+ ThreadRWMutex oceanmutex;
+
+ /* ********* sim data arrays ********* */
+
+ /* two dimensional arrays of complex */
+ fftw_complex *_fft_in; // init w sim w
+ fftw_complex *_fft_in_x; // init w sim w
+ fftw_complex *_fft_in_z; // init w sim w
+ fftw_complex *_fft_in_jxx; // init w sim w
+ fftw_complex *_fft_in_jzz; // init w sim w
+ fftw_complex *_fft_in_jxz; // init w sim w
+ fftw_complex *_fft_in_nx; // init w sim w
+ fftw_complex *_fft_in_nz; // init w sim w
+ fftw_complex *_htilda; // init w sim w (only once)
+
+ /* fftw "plans" */
+ fftw_plan _disp_y_plan; // init w sim r
+ fftw_plan _disp_x_plan; // init w sim r
+ fftw_plan _disp_z_plan; // init w sim r
+ fftw_plan _N_x_plan; // init w sim r
+ fftw_plan _N_z_plan; // init w sim r
+ fftw_plan _Jxx_plan; // init w sim r
+ fftw_plan _Jxz_plan; // init w sim r
+ fftw_plan _Jzz_plan; // init w sim r
+
+ /* two dimensional arrays of float */
+ double * _disp_y; // init w sim w via plan?
+ double * _N_x; // init w sim w via plan?
+ /*float * _N_y; all member of this array has same values, so convert this array to a float to reduce memory usage (MEM01)*/
+ double _N_y; // sim w ********* can be rearranged?
+ double * _N_z; // init w sim w via plan?
+ double * _disp_x; // init w sim w via plan?
+ double * _disp_z; // init w sim w via plan?
+
+ /* two dimensional arrays of float */
+ /* Jacobian and minimum eigenvalue */
+ double * _Jxx; // init w sim w
+ double * _Jzz; // init w sim w
+ double * _Jxz; // init w sim w
+
+ /* one dimensional float array */
+ float * _kx; // init w sim r
+ float * _kz; // init w sim r
+
+ /* two dimensional complex array */
+ fftw_complex * _h0; // init w sim r
+ fftw_complex * _h0_minus; // init w sim r
+
+ /* two dimensional float array */
+ float * _k; // init w sim r
+} Ocean;
+
+
+
+static float nextfr(float min, float max)
+{
+ return BLI_frand()*(min-max)+max;
+}
+
+static float gaussRand (void)
+{
+ float x; // Note: to avoid numerical problems with very small
+ float y; // numbers, we make these variables singe-precision
+ float length2; // floats, but later we call the double-precision log()
+ // and sqrt() functions instead of logf() and sqrtf().
+ do
+ {
+ x = (float) (nextfr (-1, 1));
+ y = (float)(nextfr (-1, 1));
+ length2 = x * x + y * y;
+ }
+ while (length2 >= 1 || length2 == 0);
+
+ return x * sqrtf(-2.0f * logf(length2) / length2);
+}
+
+/**
+ * Som usefull functions
+ * */
+MINLINE float lerp(float a,float b,float f)
+{
+ return a + (b-a)*f;
+}
+
+MINLINE float catrom(float p0,float p1,float p2,float p3,float f)
+{
+ return 0.5f *((2.0f * p1) +
+ (-p0 + p2) * f +
+ (2.0f*p0 - 5.0f*p1 + 4.0f*p2 - p3) * f*f +
+ (-p0 + 3.0f*p1- 3.0f*p2 + p3) * f*f*f);
+}
+
+MINLINE float omega(float k, float depth)
+{
+ return sqrt(GRAVITY*k * tanh(k*depth));
+}
+
+// modified Phillips spectrum
+static float Ph(struct Ocean* o, float kx,float kz )
+{
+ float tmp;
+ float k2 = kx*kx + kz*kz;
+
+ if (k2 == 0.0f)
+ {
+ return 0.0f; // no DC component
+ }
+
+ // damp out the waves going in the direction opposite the wind
+ tmp = (o->_wx * kx + o->_wz * kz)/sqrtf(k2);
+ if (tmp < 0)
+ {
+ tmp *= o->_damp_reflections;
+ }
+
+ return o->_A * expf( -1.0f / (k2*(o->_L*o->_L))) * expf(-k2 * (o->_l*o->_l)) * powf(fabsf(tmp),o->_wind_alignment) / (k2*k2);
+}
+
+static void compute_eigenstuff(struct OceanResult *ocr, float jxx,float jzz,float jxz)
+{
+ float a,b,qplus,qminus;
+ a = jxx + jzz;
+ b = sqrt((jxx - jzz)*(jxx - jzz) + 4 * jxz * jxz);
+
+ ocr->Jminus = 0.5f*(a-b);
+ ocr->Jplus = 0.5f*(a+b);
+
+ qplus = (ocr->Jplus - jxx)/jxz;
+ qminus = (ocr->Jminus - jxx)/jxz;
+
+ a = sqrt(1 + qplus*qplus);
+ b = sqrt(1 + qminus*qminus);
+
+ ocr->Eplus[0] = 1.0f/ a;
+ ocr->Eplus[1] = 0.0f;
+ ocr->Eplus[2] = qplus/a;
+
+ ocr->Eminus[0] = 1.0f/b;
+ ocr->Eminus[1] = 0.0f;
+ ocr->Eminus[2] = qminus/b;
+}
+
+/*
+ * instead of Complex.h
+ * in fftw.h "fftw_complex" typedefed as double[2]
+ * below you can see functions are needed to work with such complex numbers.
+ * */
+static void init_complex(fftw_complex cmpl, float real, float image)
+{
+ cmpl[0] = real;
+ cmpl[1] = image;
+}
+
+#if 0 // unused
+static void add_complex_f(fftw_complex res, fftw_complex cmpl, float f)
+{
+ res[0] = cmpl[0] + f;
+ res[1] = cmpl[1];
+}
+#endif
+
+static void add_comlex_c(fftw_complex res, fftw_complex cmpl1, fftw_complex cmpl2)
+{
+ res[0] = cmpl1[0] + cmpl2[0];
+ res[1] = cmpl1[1] + cmpl2[1];
+}
+
+static void mul_complex_f(fftw_complex res, fftw_complex cmpl, float f)
+{
+ res[0] = cmpl[0]*f;
+ res[1] = cmpl[1]*f;
+}
+
+static void mul_complex_c(fftw_complex res, fftw_complex cmpl1, fftw_complex cmpl2)
+{
+ fftwf_complex temp;
+ temp[0] = cmpl1[0]*cmpl2[0]-cmpl1[1]*cmpl2[1];
+ temp[1] = cmpl1[0]*cmpl2[1]+cmpl1[1]*cmpl2[0];
+ res[0] = temp[0];
+ res[1] = temp[1];
+}
+
+static float real_c(fftw_complex cmpl)
+{
+ return cmpl[0];
+}
+
+static float image_c(fftw_complex cmpl)
+{
+ return cmpl[1];
+}
+
+static void conj_complex(fftw_complex res, fftw_complex cmpl1)
+{
+ res[0] = cmpl1[0];
+ res[1] = -cmpl1[1];
+}
+
+static void exp_complex(fftw_complex res, fftw_complex cmpl)
+{
+ float r = expf(cmpl[0]);
+
+ res[0] = cos(cmpl[1])*r;
+ res[1] = sin(cmpl[1])*r;
+}
+
+float BKE_ocean_jminus_to_foam(float jminus, float coverage)
+{
+ float foam = jminus * -0.005f + coverage;
+ CLAMP(foam, 0.0f, 1.0f);
+ return foam*foam;
+}
+
+void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float v)
+{
+ int i0,i1,j0,j1;
+ float frac_x,frac_z;
+ float uu,vv;
+
+ // first wrap the texture so 0 <= (u,v) < 1
+ u = fmod(u,1.0f);
+ v = fmod(v,1.0f);
+
+ if (u < 0) u += 1.0f;
+ if (v < 0) v += 1.0f;
+
+ BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
+
+ uu = u * oc->_M;
+ vv = v * oc->_N;
+
+ i0 = (int)floor(uu);
+ j0 = (int)floor(vv);
+
+ i1 = (i0 + 1);
+ j1 = (j0 + 1);
+
+ frac_x = uu - i0;
+ frac_z = vv - j0;
+
+ i0 = i0 % oc->_M;
+ j0 = j0 % oc->_N;
+
+ i1 = i1 % oc->_M;
+ j1 = j1 % oc->_N;
+
+
+#define BILERP(m) (lerp(lerp(m[i0*oc->_N+j0],m[i1*oc->_N+j0],frac_x),lerp(m[i0*oc->_N+j1],m[i1*oc->_N+j1],frac_x),frac_z))
+ {
+ if (oc->_do_disp_y) {
+ ocr->disp[1] = BILERP(oc->_disp_y);
+ }
+
+ if (oc->_do_normals) {
+ ocr->normal[0] = BILERP(oc->_N_x);
+ ocr->normal[1] = oc->_N_y/*BILERP(oc->_N_y) (MEM01)*/;
+ ocr->normal[2] = BILERP(oc->_N_z);
+ }
+
+ if (oc->_do_chop) {
+ ocr->disp[0] = BILERP(oc->_disp_x);
+ ocr->disp[2] = BILERP(oc->_disp_z);
+ } else {
+ ocr->disp[0] = 0.0;
+ ocr->disp[2] = 0.0;
+ }
+
+ if (oc->_do_jacobian) {
+ compute_eigenstuff(ocr, BILERP(oc->_Jxx),BILERP(oc->_Jzz),BILERP(oc->_Jxz));
+ }
+ }
+#undef BILERP
+
+ BLI_rw_mutex_unlock(&oc->oceanmutex);
+}
+
+// use catmullrom interpolation rather than linear
+void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u,float v)
+{
+ int i0,i1,i2,i3,j0,j1,j2,j3;
+ float frac_x,frac_z;
+ float uu,vv;
+
+ // first wrap the texture so 0 <= (u,v) < 1
+ u = fmod(u,1.0f);
+ v = fmod(v,1.0f);
+
+ if (u < 0) u += 1.0f;
+ if (v < 0) v += 1.0f;
+
+ BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
+
+ uu = u * oc->_M;
+ vv = v * oc->_N;
+
+ i1 = (int)floor(uu);
+ j1 = (int)floor(vv);
+
+ i2 = (i1 + 1);
+ j2 = (j1 + 1);
+
+ frac_x = uu - i1;
+ frac_z = vv - j1;
+
+ i1 = i1 % oc->_M;
+ j1 = j1 % oc->_N;
+
+ i2 = i2 % oc->_M;
+ j2 = j2 % oc->_N;
+
+ i0 = (i1-1);
+ i3 = (i2+1);
+ i0 = i0 < 0 ? i0 + oc->_M : i0;
+ i3 = i3 >= oc->_M ? i3 - oc->_M : i3;
+
+ j0 = (j1-1);
+ j3 = (j2+1);
+ j0 = j0 < 0 ? j0 + oc->_N : j0;
+ j3 = j3 >= oc->_N ? j3 - oc->_N : j3;
+
+#define INTERP(m) catrom(catrom(m[i0*oc->_N+j0],m[i1*oc->_N+j0],m[i2*oc->_N+j0],m[i3*oc->_N+j0],frac_x),\
+ catrom(m[i0*oc->_N+j1],m[i1*oc->_N+j1],m[i2*oc->_N+j1],m[i3*oc->_N+j1],frac_x),\
+ catrom(m[i0*oc->_N+j2],m[i1*oc->_N+j2],m[i2*oc->_N+j2],m[i3*oc->_N+j2],frac_x),\
+ catrom(m[i0*oc->_N+j3],m[i1*oc->_N+j3],m[i2*oc->_N+j3],m[i3*oc->_N+j3],frac_x),\
+ frac_z)
+
+ {
+ if (oc->_do_disp_y)
+ {
+ ocr->disp[1] = INTERP(oc->_disp_y) ;
+ }
+ if (oc->_do_normals)
+ {
+ ocr->normal[0] = INTERP(oc->_N_x);
+ ocr->normal[1] = oc->_N_y/*INTERP(oc->_N_y) (MEM01)*/;
+ ocr->normal[2] = INTERP(oc->_N_z);
+ }
+ if (oc->_do_chop)
+ {
+ ocr->disp[0] = INTERP(oc->_disp_x);
+ ocr->disp[2] = INTERP(oc->_disp_z);
+ }
+ else
+ {
+ ocr->disp[0] = 0.0;
+ ocr->disp[2] = 0.0;
+ }
+
+ if (oc->_do_jacobian)
+ {
+ compute_eigenstuff(ocr, INTERP(oc->_Jxx),INTERP(oc->_Jzz),INTERP(oc->_Jxz));
+ }
+ }
+#undef INTERP
+
+ BLI_rw_mutex_unlock(&oc->oceanmutex);
+
+}
+
+void BKE_ocean_eval_xz(struct Ocean *oc, struct OceanResult *ocr, float x,float z)
+{
+ BKE_ocean_eval_uv(oc, ocr, x/oc->_Lx,z/oc->_Lz);
+}
+
+void BKE_ocean_eval_xz_catrom(struct Ocean *oc, struct OceanResult *ocr, float x,float z)
+{
+ BKE_ocean_eval_uv_catrom(oc, ocr, x/oc->_Lx,z/oc->_Lz);
+}
+
+// note that this doesn't wrap properly for i,j < 0, but its
+// not really meant for that being just a way to get the raw data out
+// to save in some image format.
+void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
+{
+ BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
+
+ i = abs(i) % oc->_M;
+ j = abs(j) % oc->_N;
+
+ ocr->disp[1] = oc->_do_disp_y ? oc->_disp_y[i*oc->_N+j] : 0.0f;
+
+ if (oc->_do_chop)
+ {
+ ocr->disp[0] = oc->_disp_x[i*oc->_N+j];
+ ocr->disp[2] = oc->_disp_z[i*oc->_N+j];
+ }
+ else
+ {
+ ocr->disp[0] = 0.0f;
+ ocr->disp[2] = 0.0f;
+ }
+
+ if (oc->_do_normals)
+ {
+ ocr->normal[0] = oc->_N_x[i*oc->_N+j];
+ ocr->normal[1] = oc->_N_y/*oc->_N_y[i*oc->_N+j] (MEM01)*/;
+ ocr->normal[2] = oc->_N_z[i*oc->_N+j];
+
+ normalize_v3(ocr->normal);
+ }
+
+ if (oc->_do_jacobian)
+ {
+ compute_eigenstuff(ocr, oc->_Jxx[i*oc->_N+j],oc->_Jzz[i*oc->_N+j],oc->_Jxz[i*oc->_N+j]);
+ }
+
+ BLI_rw_mutex_unlock(&oc->oceanmutex);
+}
+
+void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount)
+{
+ int i, j;
+
+ scale *= o->normalize_factor;
+
+ BLI_rw_mutex_lock(&o->oceanmutex, THREAD_LOCK_WRITE);
+
+ // compute a new htilda
+#pragma omp parallel for private(i, j)
+ for (i = 0 ; i < o->_M ; ++i)
+ {
+ // note the <= _N/2 here, see the fftw doco about
+ // the mechanics of the complex->real fft storage
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex exp_param1;
+ fftw_complex exp_param2;
+ fftw_complex conj_param;
+
+
+ init_complex(exp_param1, 0.0, omega(o->_k[i*(1+o->_N/2)+j],o->_depth)*t);
+ init_complex(exp_param2, 0.0, -omega(o->_k[i*(1+o->_N/2)+j],o->_depth)*t);
+ exp_complex(exp_param1, exp_param1);
+ exp_complex(exp_param2, exp_param2);
+ conj_complex(conj_param, o->_h0_minus[i*o->_N+j]);
+
+ mul_complex_c(exp_param1, o->_h0[i*o->_N+j], exp_param1);
+ mul_complex_c(exp_param2, conj_param, exp_param2);
+
+ add_comlex_c(o->_htilda[i*(1+o->_N/2)+j], exp_param1, exp_param2);
+ mul_complex_f(o->_fft_in[i*(1+o->_N/2)+j], o->_htilda[i*(1+o->_N/2)+j], scale);
+ }
+ }
+
+#pragma omp parallel sections private(i, j)
+ {
+
+#pragma omp section
+ {
+ if (o->_do_disp_y)
+ {
+ // y displacement
+ fftw_execute(o->_disp_y_plan);
+ }
+ } // section 1
+
+#pragma omp section
+ {
+ if (o->_do_chop)
+ {
+ // x displacement
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+ fftw_complex minus_i;
+
+ init_complex(minus_i, 0.0, -1.0);
+ init_complex(mul_param, -scale, 0);
+ mul_complex_f(mul_param, mul_param, chop_amount);
+ mul_complex_c(mul_param, mul_param, minus_i);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, (o->_k[i*(1+o->_N/2)+j] == 0.0 ? 0.0 : o->_kx[i] / o->_k[i*(1+o->_N/2)+j]));
+ init_complex(o->_fft_in_x[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_disp_x_plan);
+ }
+ } //section 2
+
+#pragma omp section
+ {
+ if (o->_do_chop)
+ {
+ // z displacement
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+ fftw_complex minus_i;
+
+ init_complex(minus_i, 0.0, -1.0);
+ init_complex(mul_param, -scale, 0);
+ mul_complex_f(mul_param, mul_param, chop_amount);
+ mul_complex_c(mul_param, mul_param, minus_i);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, (o->_k[i*(1+o->_N/2)+j] == 0.0 ? 0.0 : o->_kz[j] / o->_k[i*(1+o->_N/2)+j]));
+ init_complex(o->_fft_in_z[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_disp_z_plan);
+ }
+ } // section 3
+
+#pragma omp section
+ {
+ if (o->_do_jacobian)
+ {
+ // Jxx
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+
+ //init_complex(mul_param, -scale, 0);
+ init_complex(mul_param, -1, 0);
+
+ mul_complex_f(mul_param, mul_param, chop_amount);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, (o->_k[i*(1+o->_N/2)+j] == 0.0 ? 0.0 : o->_kx[i]*o->_kx[i] / o->_k[i*(1+o->_N/2)+j]));
+ init_complex(o->_fft_in_jxx[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_Jxx_plan);
+
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j < o->_N ; ++j)
+ {
+ o->_Jxx[i*o->_N+j] += 1.0;
+ }
+ }
+ }
+ } // section 4
+
+#pragma omp section
+ {
+ if (o->_do_jacobian)
+ {
+ // Jzz
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+
+ //init_complex(mul_param, -scale, 0);
+ init_complex(mul_param, -1, 0);
+
+ mul_complex_f(mul_param, mul_param, chop_amount);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, (o->_k[i*(1+o->_N/2)+j] == 0.0 ? 0.0 : o->_kz[j]*o->_kz[j] / o->_k[i*(1+o->_N/2)+j]));
+ init_complex(o->_fft_in_jzz[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_Jzz_plan);
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j < o->_N ; ++j)
+ {
+ o->_Jzz[i*o->_N+j] += 1.0;
+ }
+ }
+ }
+ } // section 5
+
+#pragma omp section
+ {
+ if (o->_do_jacobian)
+ {
+ // Jxz
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+
+ //init_complex(mul_param, -scale, 0);
+ init_complex(mul_param, -1, 0);
+
+ mul_complex_f(mul_param, mul_param, chop_amount);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, (o->_k[i*(1+o->_N/2)+j] == 0.0f ? 0.0f : o->_kx[i]*o->_kz[j] / o->_k[i*(1+o->_N/2)+j]));
+ init_complex(o->_fft_in_jxz[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_Jxz_plan);
+ }
+ } // section 6
+
+#pragma omp section
+ {
+ // fft normals
+ if (o->_do_normals)
+ {
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+
+ init_complex(mul_param, 0.0, -1.0);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, o->_kx[i]);
+ init_complex(o->_fft_in_nx[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ fftw_execute(o->_N_x_plan);
+
+ }
+ } // section 7
+
+#pragma omp section
+ {
+ if (o->_do_normals)
+ {
+ for ( i = 0 ; i < o->_M ; ++i)
+ {
+ for ( j = 0 ; j <= o->_N / 2 ; ++j)
+ {
+ fftw_complex mul_param;
+
+ init_complex(mul_param, 0.0, -1.0);
+ mul_complex_c(mul_param, mul_param, o->_htilda[i*(1+o->_N/2)+j]);
+ mul_complex_f(mul_param, mul_param, o->_kz[i]);
+ init_complex(o->_fft_in_nz[i*(1+o->_N/2)+j], real_c(mul_param), image_c(mul_param));
+ }
+ }
+ 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)*/
+ o->_N_y = 1.0f/scale;
+ }
+ } // section 8
+
+ } // omp sections
+
+ BLI_rw_mutex_unlock(&o->oceanmutex);
+}
+
+static void set_height_normalize_factor(struct Ocean *oc)
+{
+ float res = 1.0;
+ float max_h = 0.0;
+
+ int i,j;
+
+ if (!oc->_do_disp_y) return;
+
+ oc->normalize_factor = 1.0;
+
+ BKE_simulate_ocean(oc, 0.0, 1.0, 0);
+
+ BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
+
+ for (i = 0; i < oc->_M; ++i)
+ {
+ for (j = 0; j < oc->_N; ++j)
+ {
+ if( max_h < fabsf(oc->_disp_y[i*oc->_N+j]))
+ {
+ max_h = fabsf(oc->_disp_y[i*oc->_N+j]);
+ }
+ }
+ }
+
+ BLI_rw_mutex_unlock(&oc->oceanmutex);
+
+ if (max_h == 0.0f) max_h = 0.00001f; // just in case ...
+
+ res = 1.0f / (max_h);
+
+ oc->normalize_factor = res;
+}
+
+struct Ocean *BKE_add_ocean(void)
+{
+ Ocean *oc = MEM_callocN(sizeof(Ocean), "ocean sim data");
+
+ BLI_rw_mutex_init(&oc->oceanmutex);
+
+ return oc;
+}
+
+void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
+ float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed)
+{
+ int i,j,ii;
+
+ BLI_rw_mutex_lock(&o->oceanmutex, THREAD_LOCK_WRITE);
+
+ o->_M = M;
+ o->_N = N;
+ o->_V = V;
+ o->_l = l;
+ o->_A = A;
+ o->_w = w;
+ o->_damp_reflections = 1.0f - damp;
+ o->_wind_alignment = alignment;
+ o->_depth = depth;
+ o->_Lx = Lx;
+ o->_Lz = Lz;
+ o->_wx = cos(w);
+ o->_wz = -sin(w); // wave direction
+ o->_L = V*V / GRAVITY; // largest wave for a given velocity V
+ o->time = time;
+
+ o->_do_disp_y = do_height_field;
+ o->_do_normals = do_normals;
+ o->_do_chop = do_chop;
+ o->_do_jacobian = do_jacobian;
+
+ o->_k = (float*) MEM_mallocN(M * (1+N/2) * sizeof(float), "ocean_k");
+ o->_h0 = (fftw_complex*) MEM_mallocN(M * N * sizeof(fftw_complex), "ocean_h0");
+ o->_h0_minus = (fftw_complex*) MEM_mallocN(M * N * sizeof(fftw_complex), "ocean_h0_minus");
+ o->_kx = (float*) MEM_mallocN(o->_M * sizeof(float), "ocean_kx");
+ o->_kz = (float*) MEM_mallocN(o->_N * sizeof(float), "ocean_kz");
+
+ // make this robust in the face of erroneous usage
+ if (o->_Lx == 0.0f)
+ o->_Lx = 0.001f;
+
+ if (o->_Lz == 0.0f)
+ o->_Lz = 0.001f;
+
+ // the +ve components and DC
+ for (i = 0 ; i <= o->_M/2 ; ++i)
+ o->_kx[i] = 2.0f * (float)M_PI * i / o->_Lx;
+
+ // the -ve components
+ for (i = o->_M-1,ii=0 ; i > o->_M/2 ; --i,++ii)
+ o->_kx[i] = -2.0f * (float)M_PI * ii / o->_Lx;
+
+ // the +ve components and DC
+ for (i = 0 ; i <= o->_N/2 ; ++i)
+ o->_kz[i] = 2.0f * (float)M_PI * i / o->_Lz;
+
+ // the -ve components
+ for (i = o->_N-1,ii=0 ; i > o->_N/2 ; --i,++ii)
+ o->_kz[i] = -2.0f * (float)M_PI * ii / o->_Lz;
+
+ // pre-calculate the k matrix
+ for (i = 0 ; i < o->_M ; ++i)
+ for (j = 0 ; j <= o->_N / 2 ; ++j)
+ o->_k[i*(1+o->_N/2)+j] = sqrt(o->_kx[i]*o->_kx[i] + o->_kz[j]*o->_kz[j] );
+
+ /*srand(seed);*/
+ BLI_srand(seed);
+
+ for (i = 0 ; i < o->_M ; ++i)
+ {
+ for (j = 0 ; j < o->_N ; ++j)
+ {
+ float r1 = gaussRand();
+ float r2 = gaussRand();
+
+ fftw_complex r1r2;
+ init_complex(r1r2, r1, r2);
+ mul_complex_f(o->_h0[i*o->_N+j], r1r2, (float)(sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f)));
+ mul_complex_f(o->_h0_minus[i*o->_N+j], r1r2, (float)(sqrt(Ph(o, -o->_kx[i],-o->_kz[j]) / 2.0f)));
+ }
+ }
+
+ o->_fft_in = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in");
+ o->_htilda = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_htilda");
+
+ if (o->_do_disp_y){
+ o->_disp_y = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_y");
+ o->_disp_y_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in, o->_disp_y, FFTW_ESTIMATE);
+ }
+
+ if (o->_do_normals){
+ o->_fft_in_nx = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_nx");
+ o->_fft_in_nz = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_nz");
+
+ o->_N_x = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_N_x");
+ /*o->_N_y = (float*) fftwf_malloc(o->_M * o->_N * sizeof(float)); (MEM01)*/
+ o->_N_z = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_N_z");
+
+ o->_N_x_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_nx, o->_N_x, FFTW_ESTIMATE);
+ o->_N_z_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_nz, o->_N_z, FFTW_ESTIMATE);
+ }
+
+ if (o->_do_chop){
+ o->_fft_in_x = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_x");
+ o->_fft_in_z = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_z");
+
+ o->_disp_x = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_x");
+ o->_disp_z = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_z");
+
+ o->_disp_x_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_x, o->_disp_x, FFTW_ESTIMATE);
+ o->_disp_z_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_z, o->_disp_z, FFTW_ESTIMATE);
+ }
+ if (o->_do_jacobian){
+ o->_fft_in_jxx = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_jxx");
+ o->_fft_in_jzz = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_jzz");
+ o->_fft_in_jxz = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_jxz");
+
+ o->_Jxx = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_Jxx");
+ o->_Jzz = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_Jzz");
+ o->_Jxz = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_Jxz");
+
+ o->_Jxx_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jxx, o->_Jxx, FFTW_ESTIMATE);
+ o->_Jzz_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jzz, o->_Jzz, FFTW_ESTIMATE);
+ o->_Jxz_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jxz, o->_Jxz, FFTW_ESTIMATE);
+ }
+
+ BLI_rw_mutex_unlock(&o->oceanmutex);
+
+ set_height_normalize_factor(o);
+
+}
+
+void BKE_free_ocean_data(struct Ocean *oc)
+{
+ if(!oc) return;
+
+ BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_WRITE);
+
+ if (oc->_do_disp_y)
+ {
+ fftw_destroy_plan(oc->_disp_y_plan);
+ MEM_freeN(oc->_disp_y);
+ }
+
+ if (oc->_do_normals)
+ {
+ MEM_freeN(oc->_fft_in_nx);
+ MEM_freeN(oc->_fft_in_nz);
+ fftw_destroy_plan(oc->_N_x_plan);
+ fftw_destroy_plan(oc->_N_z_plan);
+ MEM_freeN(oc->_N_x);
+ /*fftwf_free(oc->_N_y); (MEM01)*/
+ MEM_freeN(oc->_N_z);
+ }
+
+ if (oc->_do_chop)
+ {
+ MEM_freeN(oc->_fft_in_x);
+ MEM_freeN(oc->_fft_in_z);
+ fftw_destroy_plan(oc->_disp_x_plan);
+ fftw_destroy_plan(oc->_disp_z_plan);
+ MEM_freeN(oc->_disp_x);
+ MEM_freeN(oc->_disp_z);
+ }
+
+ if (oc->_do_jacobian)
+ {
+ MEM_freeN(oc->_fft_in_jxx);
+ MEM_freeN(oc->_fft_in_jzz);
+ MEM_freeN(oc->_fft_in_jxz);
+ fftw_destroy_plan(oc->_Jxx_plan);
+ fftw_destroy_plan(oc->_Jzz_plan);
+ fftw_destroy_plan(oc->_Jxz_plan);
+ MEM_freeN(oc->_Jxx);
+ MEM_freeN(oc->_Jzz);
+ MEM_freeN(oc->_Jxz);
+ }
+
+ if (oc->_fft_in)
+ MEM_freeN(oc->_fft_in);
+
+ /* check that ocean data has been initialised */
+ if (oc->_htilda) {
+ MEM_freeN(oc->_htilda);
+ MEM_freeN(oc->_k);
+ MEM_freeN(oc->_h0);
+ MEM_freeN(oc->_h0_minus);
+ MEM_freeN(oc->_kx);
+ MEM_freeN(oc->_kz);
+ }
+
+ BLI_rw_mutex_unlock(&oc->oceanmutex);
+}
+
+void BKE_free_ocean(struct Ocean *oc)
+{
+ if(!oc) return;
+
+ BKE_free_ocean_data(oc);
+ BLI_rw_mutex_end(&oc->oceanmutex);
+
+ MEM_freeN(oc);
+}
+
+#undef GRAVITY
+
+
+/* ********* Baking/Caching ********* */
+
+
+#define CACHE_TYPE_DISPLACE 1
+#define CACHE_TYPE_FOAM 2
+#define CACHE_TYPE_NORMAL 3
+
+static void cache_filename(char *string, const char *path, const char *relbase, int frame, int type)
+{
+ char cachepath[FILE_MAX];
+ const char *fname;
+
+ switch(type) {
+ case CACHE_TYPE_FOAM:
+ fname= "foam_";
+ break;
+ case CACHE_TYPE_NORMAL:
+ fname= "normal_";
+ break;
+ case CACHE_TYPE_DISPLACE:
+ default:
+ fname= "disp_";
+ break;
+ }
+
+ BLI_join_dirfile(cachepath, sizeof(cachepath), path, fname);
+
+ BKE_makepicstring(string, cachepath, relbase, frame, R_OPENEXR, 1, TRUE);
+}
+
+void BKE_free_ocean_cache(struct OceanCache *och)
+{
+ int i, f=0;
+
+ if (!och) return;
+
+ if (och->ibufs_disp) {
+ for (i=och->start, f=0; i<=och->end; i++, f++)
+ {
+ if (och->ibufs_disp[f]) {
+ IMB_freeImBuf(och->ibufs_disp[f]);
+ }
+ }
+ MEM_freeN(och->ibufs_disp);
+ }
+
+ if (och->ibufs_foam) {
+ for (i=och->start, f=0; i<=och->end; i++, f++)
+ {
+ if (och->ibufs_foam[f]) {
+ IMB_freeImBuf(och->ibufs_foam[f]);
+ }
+ }
+ MEM_freeN(och->ibufs_foam);
+ }
+
+ if (och->ibufs_norm) {
+ for (i=och->start, f=0; i<=och->end; i++, f++)
+ {
+ if (och->ibufs_norm[f]) {
+ IMB_freeImBuf(och->ibufs_norm[f]);
+ }
+ }
+ MEM_freeN(och->ibufs_norm);
+ }
+
+ if (och->time)
+ MEM_freeN(och->time);
+ MEM_freeN(och);
+}
+
+void BKE_ocean_cache_eval_uv(struct OceanCache *och, struct OceanResult *ocr, int f, float u, float v)
+{
+ int res_x = och->resolution_x;
+ int res_y = och->resolution_y;
+ float result[4];
+
+ u = fmod(u, 1.0);
+ v = fmod(v, 1.0);
+
+ if (u < 0) u += 1.0f;
+ if (v < 0) v += 1.0f;
+
+ if (och->ibufs_disp[f]) {
+ ibuf_sample(och->ibufs_disp[f], u, v, (1.0f/(float)res_x), (1.0f/(float)res_y), result);
+ ocr->disp[0] = result[0];
+ ocr->disp[1] = result[1];
+ ocr->disp[2] = result[2];
+ }
+
+ if (och->ibufs_foam[f]) {
+ ibuf_sample(och->ibufs_foam[f], u, v, (1.0f/(float)res_x), (1.0f/(float)res_y), result);
+ ocr->foam = result[0];
+ }
+
+ if (och->ibufs_norm[f]) {
+ ibuf_sample(och->ibufs_norm[f], u, v, (1.0f/(float)res_x), (1.0f/(float)res_y), result);
+ ocr->normal[0] = result[0];
+ ocr->normal[1] = result[1];
+ ocr->normal[2] = result[2];
+ }
+}
+
+void BKE_ocean_cache_eval_ij(struct OceanCache *och, struct OceanResult *ocr, int f, int i, int j)
+{
+ int res_x = och->resolution_x;
+ int res_y = och->resolution_y;
+
+ i = abs(i) % res_x;
+ j = abs(j) % res_y;
+
+ if (och->ibufs_disp[f]) {
+ ocr->disp[0] = och->ibufs_disp[f]->rect_float[4*(res_x*j + i) + 0];
+ ocr->disp[1] = och->ibufs_disp[f]->rect_float[4*(res_x*j + i) + 1];
+ ocr->disp[2] = och->ibufs_disp[f]->rect_float[4*(res_x*j + i) + 2];
+ }
+
+ if (och->ibufs_foam[f]) {
+ ocr->foam = och->ibufs_foam[f]->rect_float[4*(res_x*j + i) + 0];
+ }
+
+ if (och->ibufs_norm[f]) {
+ ocr->normal[0] = och->ibufs_norm[f]->rect_float[4*(res_x*j + i) + 0];
+ ocr->normal[1] = och->ibufs_norm[f]->rect_float[4*(res_x*j + i) + 1];
+ ocr->normal[2] = och->ibufs_norm[f]->rect_float[4*(res_x*j + i) + 2];
+ }
+}
+
+struct OceanCache *BKE_init_ocean_cache(const char *bakepath, const char *relbase,
+ int start, int end, float wave_scale,
+ float chop_amount, float foam_coverage, float foam_fade, int resolution)
+{
+ OceanCache *och = MEM_callocN(sizeof(OceanCache), "ocean cache data");
+
+ och->bakepath = bakepath;
+ och->relbase = relbase;
+
+ och->start = start;
+ och->end = end;
+ och->duration = (end - start) + 1;
+ och->wave_scale = wave_scale;
+ och->chop_amount = chop_amount;
+ och->foam_coverage = foam_coverage;
+ och->foam_fade = foam_fade;
+ och->resolution_x = resolution*resolution;
+ och->resolution_y = resolution*resolution;
+
+ och->ibufs_disp = MEM_callocN(sizeof(ImBuf *)*och->duration, "displacement imbuf pointer array");
+ och->ibufs_foam = MEM_callocN(sizeof(ImBuf *)*och->duration, "foam imbuf pointer array");
+ och->ibufs_norm = MEM_callocN(sizeof(ImBuf *)*och->duration, "normal imbuf pointer array");
+
+ och->time = NULL;
+
+ return och;
+}
+
+void BKE_simulate_ocean_cache(struct OceanCache *och, int frame)
+{
+ char string[FILE_MAX];
+ int f = frame;
+
+ /* ibufs array is zero based, but filenames are based on frame numbers */
+ /* still need to clamp frame numbers to valid range of images on disk though */
+ CLAMP(frame, och->start, och->end);
+ f = frame - och->start; // shift to 0 based
+
+ /* if image is already loaded in mem, return */
+ if (och->ibufs_disp[f] != NULL ) return;
+
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+
+void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(void *, float progress, int *cancel), void *update_cb_data)
+{
+ /* note: some of these values remain uninitialized unless certain options
+ * are enabled, take care that BKE_ocean_eval_ij() initializes a member
+ * before use - campbell */
+ OceanResult ocr;
+
+ int f, i=0, x, y, cancel=0;
+ float progress;
+
+ ImBuf *ibuf_foam, *ibuf_disp, *ibuf_normal;
+ float *prev_foam;
+ int res_x = och->resolution_x;
+ int res_y = och->resolution_y;
+ char string[FILE_MAX];
+
+ if (!o) return;
+
+ if (o->_do_jacobian) prev_foam = MEM_callocN(res_x*res_y*sizeof(float), "previous frame foam bake data");
+ else prev_foam = NULL;
+
+ BLI_srand(0);
+
+ for (f=och->start, i=0; f<=och->end; f++, i++) {
+
+ /* create a new imbuf to store image for this frame */
+ ibuf_foam = IMB_allocImBuf(res_x, res_y, 32, IB_rectfloat);
+ ibuf_disp = IMB_allocImBuf(res_x, res_y, 32, IB_rectfloat);
+ ibuf_normal = IMB_allocImBuf(res_x, res_y, 32, IB_rectfloat);
+
+ ibuf_disp->profile = ibuf_foam->profile = ibuf_normal->profile = IB_PROFILE_LINEAR_RGB;
+
+ BKE_simulate_ocean(o, och->time[i], och->wave_scale, och->chop_amount);
+
+ /* add new foam */
+ for (y=0; y < res_y; y++) {
+ for (x=0; x < res_x; x++) {
+
+ BKE_ocean_eval_ij(o, &ocr, x, y);
+
+ /* add to the image */
+ ibuf_disp->rect_float[4*(res_x*y + x) + 0] = ocr.disp[0];
+ ibuf_disp->rect_float[4*(res_x*y + x) + 1] = ocr.disp[1];
+ ibuf_disp->rect_float[4*(res_x*y + x) + 2] = ocr.disp[2];
+ ibuf_disp->rect_float[4*(res_x*y + x) + 3] = 1.0f;
+
+ if (o->_do_jacobian) {
+ /* TODO, cleanup unused code - campbell */
+
+ float /*r,*/ /* UNUSED */ pr=0.0f, foam_result;
+ float neg_disp, neg_eplus;
+
+ ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, och->foam_coverage);
+
+ /* accumulate previous value for this cell */
+ if (i > 0) {
+ pr = prev_foam[res_x*y + x];
+ }
+
+ /* r = BLI_frand(); */ /* UNUSED */ // randomly reduce foam
+
+ //pr = pr * och->foam_fade; // overall fade
+
+ // remember ocean coord sys is Y up!
+ // break up the foam where height (Y) is low (wave valley),
+ // and X and Z displacement is greatest
+
+ /*
+ vec[0] = ocr.disp[0];
+ vec[1] = ocr.disp[2];
+ hor_stretch = len_v2(vec);
+ CLAMP(hor_stretch, 0.0, 1.0);
+ */
+
+ neg_disp = ocr.disp[1] < 0.0f ? 1.0f+ocr.disp[1] : 1.0f;
+ neg_disp = neg_disp < 0.0f ? 0.0f : neg_disp;
+
+ /* foam, 'ocr.Eplus' only initialized with do_jacobian */
+ neg_eplus = ocr.Eplus[2] < 0.0f ? 1.0f + ocr.Eplus[2]:1.0f;
+ neg_eplus = neg_eplus<0.0f ? 0.0f : neg_eplus;
+
+ //if (ocr.disp[1] < 0.0 || r > och->foam_fade)
+ // pr *= och->foam_fade;
+
+
+ //pr = pr * (1.0 - hor_stretch) * ocr.disp[1];
+ //pr = pr * neg_disp * neg_eplus;
+
+ if (pr < 1.0f) pr *=pr;
+
+ pr *= och->foam_fade * (0.75f + neg_eplus * 0.25f);
+
+
+ foam_result = pr + ocr.foam;
+
+ prev_foam[res_x*y + x] = foam_result;
+
+ ibuf_foam->rect_float[4*(res_x*y + x) + 0] = foam_result;
+ ibuf_foam->rect_float[4*(res_x*y + x) + 1] = foam_result;
+ ibuf_foam->rect_float[4*(res_x*y + x) + 2] = foam_result;
+ ibuf_foam->rect_float[4*(res_x*y + x) + 3] = 1.0;
+ }
+
+ if (o->_do_normals) {
+ ibuf_normal->rect_float[4*(res_x*y + x) + 0] = ocr.normal[0];
+ ibuf_normal->rect_float[4*(res_x*y + x) + 1] = ocr.normal[1];
+ ibuf_normal->rect_float[4*(res_x*y + x) + 2] = ocr.normal[2];
+ ibuf_normal->rect_float[4*(res_x*y + x) + 3] = 1.0;
+ }
+ }
+ }
+
+ /* write the images */
+ cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_DISPLACE);
+ if(0 == BKE_write_ibuf(ibuf_disp, string, R_OPENEXR, R_OPENEXR_HALF, 2)) // 2 == ZIP exr codec
+ 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, R_OPENEXR, R_OPENEXR_HALF, 2)) // 2 == ZIP exr codec
+ 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, R_OPENEXR, R_OPENEXR_HALF, 2)) // 2 == ZIP exr codec
+ printf("Cannot save Normal File Output to %s\n", string);
+ }
+
+ IMB_freeImBuf(ibuf_disp);
+ IMB_freeImBuf(ibuf_foam);
+ IMB_freeImBuf(ibuf_normal);
+
+ progress = (f - och->start) / (float)och->duration;
+
+ update_cb(update_cb_data, progress, &cancel);
+
+ if (cancel) {
+ if (prev_foam) MEM_freeN(prev_foam);
+ return;
+ }
+ }
+
+ if (prev_foam) MEM_freeN(prev_foam);
+ och->baked = 1;
+}
+
+#else // WITH_OCEANSIM
+
+/* stub */
+typedef struct Ocean {
+ /* need some data here, C does not allow empty struct */
+ int stub;
+} Ocean;
+
+
+float BKE_ocean_jminus_to_foam(float UNUSED(jminus), float UNUSED(coverage)) {
+ return 0.0f;
+}
+
+void BKE_ocean_eval_uv(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u),float UNUSED(v))
+{
+}
+
+// use catmullrom interpolation rather than linear
+void BKE_ocean_eval_uv_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u),float UNUSED(v))
+{
+}
+
+void BKE_ocean_eval_xz(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x),float UNUSED(z))
+{
+}
+
+void BKE_ocean_eval_xz_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x),float UNUSED(z))
+{
+}
+
+void BKE_ocean_eval_ij(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), int UNUSED(i),int UNUSED(j))
+{
+}
+
+void BKE_simulate_ocean(struct Ocean *UNUSED(o), float UNUSED(t), float UNUSED(scale), float UNUSED(chop_amount))
+{
+}
+
+struct Ocean *BKE_add_ocean(void)
+{
+ Ocean *oc = MEM_callocN(sizeof(Ocean), "ocean sim data");
+
+ return oc;
+}
+
+void BKE_init_ocean(struct Ocean* UNUSED(o), int UNUSED(M),int UNUSED(N), float UNUSED(Lx), float UNUSED(Lz), float UNUSED(V), float UNUSED(l), float UNUSED(A), float UNUSED(w), float UNUSED(damp),
+ float UNUSED(alignment), float UNUSED(depth), float UNUSED(time), short UNUSED(do_height_field), short UNUSED(do_chop), short UNUSED(do_normals), short UNUSED(do_jacobian), int UNUSED(seed))
+{
+}
+
+void BKE_free_ocean_data(struct Ocean *UNUSED(oc))
+{
+}
+
+void BKE_free_ocean(struct Ocean *oc)
+{
+ if(!oc) return;
+ MEM_freeN(oc);
+}
+
+
+/* ********* Baking/Caching ********* */
+
+
+void BKE_free_ocean_cache(struct OceanCache *och)
+{
+ if (!och) return;
+
+ MEM_freeN(och);
+}
+
+void BKE_ocean_cache_eval_uv(struct OceanCache *UNUSED(och), struct OceanResult *UNUSED(ocr), int UNUSED(f), float UNUSED(u), float UNUSED(v))
+{
+}
+
+void BKE_ocean_cache_eval_ij(struct OceanCache *UNUSED(och), struct OceanResult *UNUSED(ocr), int UNUSED(f), int UNUSED(i), int UNUSED(j))
+{
+}
+
+struct OceanCache *BKE_init_ocean_cache(const char *UNUSED(bakepath), const char *UNUSED(relbase),
+ int UNUSED(start), int UNUSED(end), float UNUSED(wave_scale),
+ float UNUSED(chop_amount), float UNUSED(foam_coverage), float UNUSED(foam_fade), int UNUSED(resolution))
+{
+ OceanCache *och = MEM_callocN(sizeof(OceanCache), "ocean cache data");
+
+ return och;
+}
+
+void BKE_simulate_ocean_cache(struct OceanCache *UNUSED(och), int UNUSED(frame))
+{
+}
+
+void BKE_bake_ocean(struct Ocean *UNUSED(o), struct OceanCache *UNUSED(och), void (*update_cb)(void *, float progress, int *cancel), void *UNUSED(update_cb_data))
+{
+ /* unused */
+ (void)update_cb;
+}
+#endif // WITH_OCEANSIM
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index d28fe8b8509..220068780a7 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1911,7 +1911,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
switch(type) {
case PART_KINK_CURL:
{
- mul_v3_fl(par_vec, -1.f);
+ negate_v3(par_vec);
if(flat > 0.f) {
float proj[3];
@@ -1977,7 +1977,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
mul_qt_v3(par_rot, z_vec);
}
- mul_v3_fl(par_vec, -1.f);
+ negate_v3(par_vec);
normalize_v3_v3(vec_one, par_vec);
inp_y=dot_v3v3(y_vec, vec_one);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index cb12230615e..a955643cbcc 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2679,7 +2679,7 @@ static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisi
}
if(pce->inv_nor == 1) {
- mul_v3_fl(nor, -1.f);
+ negate_v3(nor);
d = -d;
}
@@ -2799,7 +2799,7 @@ static void collision_point_on_surface(float p[3], ParticleCollisionElement *pce
normalize_v3(nor);
if(pce->inv_nor == 1)
- mul_v3_fl(nor, -1.f);
+ negate_v3(nor);
madd_v3_v3v3fl(co, pce->x0, nor, col->radius);
madd_v3_v3fl(co, e1, pce->uv[0]);
@@ -3935,9 +3935,10 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
// return;
// ok, start loading
- BLI_snprintf(filename, sizeof(filename), "%sfluidsurface_particles_####.gz", fss->surfdataPath);
-
- BLI_path_abs(filename, G.main->name);
+ BLI_join_dirfile(filename, sizeof(filename), fss->surfdataPath, OB_FLUIDSIM_SURF_PARTICLES_FNAME);
+
+ BLI_path_abs(filename, modifier_path_relbase(sim->ob));
+
BLI_path_frame(filename, curFrame, 0); // fixed #frame-no
gzf = gzopen(filename, "rb");
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 37c0761e5be..ae958db3d4a 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -44,6 +44,7 @@
#include "DNA_anim_types.h"
#include "DNA_group_types.h"
+#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
@@ -490,7 +491,7 @@ Scene *add_scene(const char *name)
sce->r.osa= 8;
/* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
- scene_add_render_layer(sce);
+ scene_add_render_layer(sce, NULL);
/* game data */
sce->gm.stereoflag = STEREO_NOSTEREO;
@@ -1093,13 +1094,15 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
}
/* return default layer, also used to patch old files */
-void scene_add_render_layer(Scene *sce)
+SceneRenderLayer *scene_add_render_layer(Scene *sce, const char *name)
{
SceneRenderLayer *srl;
-// int tot= 1 + BLI_countlist(&sce->r.layers);
-
+
+ if(!name)
+ name= "RenderLayer";
+
srl= MEM_callocN(sizeof(SceneRenderLayer), "new render layer");
- strcpy(srl->name, "RenderLayer");
+ BLI_strncpy(srl->name, name, sizeof(srl->name));
BLI_uniquename(&sce->r.layers, srl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(srl->name));
BLI_addtail(&sce->r.layers, srl);
@@ -1108,6 +1111,45 @@ void scene_add_render_layer(Scene *sce)
srl->layflag= 0x7FFF; /* solid ztra halo edge strand */
srl->passflag= SCE_PASS_COMBINED|SCE_PASS_Z;
FRS_add_freestyle_config( srl );
+
+ return srl;
+}
+
+int scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
+{
+ const int act= BLI_findindex(&scene->r.layers, srl);
+ Scene *sce;
+
+ if (act == -1) {
+ return 0;
+ }
+ else if ( (scene->r.layers.first == scene->r.layers.last) &&
+ (scene->r.layers.first == srl))
+ {
+ /* ensure 1 layer is kept */
+ return 0;
+ }
+
+ BLI_remlink(&scene->r.layers, srl);
+ MEM_freeN(srl);
+
+ scene->r.actlay= 0;
+
+ for(sce = bmain->scene.first; 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_R_LAYERS && (Scene*)node->id==scene) {
+ if(node->custom1==act)
+ node->custom1= 0;
+ else if(node->custom1>act)
+ node->custom1--;
+ }
+ }
+ }
+ }
+
+ return 1;
}
/* render simplification */
@@ -1171,6 +1213,6 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base)
int scene_use_new_shading_nodes(Scene *scene)
{
RenderEngineType *type= RE_engines_find(scene->r.engine);
- return (type->flag & RE_USE_SHADING_NODES);
+ return (type && type->flag & RE_USE_SHADING_NODES);
}
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 53878176fec..5d35867d9c3 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -594,6 +594,9 @@ void calc_sequence(Scene *scene, Sequence *seq)
// seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
if (seq->seq1) {
+ /* 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);
/* we cant help if strips don't overlap, it wont give useful results.
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index d3d6a658ede..cab621eeff7 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -2368,7 +2368,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* ---springs */
}/*omit on snap */
}/*loop all bp's*/
-return 0; /*done fine*/
+ return 0; /*done fine*/
}
static void *exec_softbody_calc_forces(void *data)
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index e8be0bb2608..5735a95764b 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -796,6 +796,7 @@ void txt_move_left(Text *text, short sel)
{
TextLine **linep;
int *charp, oundoing= undoing;
+ int tabsize = 1, i=0;
if (!text) return;
if(sel) txt_curs_sel(text, &linep, &charp);
@@ -803,14 +804,34 @@ void txt_move_left(Text *text, short sel)
if (!*linep) return;
undoing= 1;
+
+ // do nice left only if there are only spaces
+ // TXT_TABSIZE hardcoded in DNA_text_types.h
+ if (text->flags & TXT_TABSTOSPACES) {
+ tabsize = TXT_TABSIZE;
+
+ if (*charp < tabsize)
+ tabsize = *charp;
+ else {
+ for (i=0;i<(*charp);i++)
+ if ((*linep)->line[i] != ' ') {
+ tabsize = 1;
+ break;
+ }
+ // if in the middle of the space-tab
+ if ((*charp) % tabsize != 0)
+ tabsize = ((*charp) % tabsize);
+ }
+ }
+
if (*charp== 0) {
if ((*linep)->prev) {
txt_move_up(text, sel);
*charp= (*linep)->len;
}
- } else {
- (*charp)--;
}
+ else (*charp)-= tabsize;
+
undoing= oundoing;
if(!undoing) txt_undo_add_op(text, sel?UNDO_SLEFT:UNDO_CLEFT);
@@ -821,6 +842,7 @@ void txt_move_right(Text *text, short sel)
{
TextLine **linep;
int *charp, oundoing= undoing;
+ int tabsize=1, i=0;
if (!text) return;
if(sel) txt_curs_sel(text, &linep, &charp);
@@ -828,13 +850,32 @@ void txt_move_right(Text *text, short sel)
if (!*linep) return;
undoing= 1;
+
+ // do nice right only if there are only spaces
+ // spaces hardcoded in DNA_text_types.h
+ if (text->flags & TXT_TABSTOSPACES) {
+ tabsize = TXT_TABSIZE;
+
+ if ((*charp) + tabsize > (*linep)->len)
+ tabsize = 1;
+ else {
+ for (i=0;i<(*charp) + tabsize - ((*charp) % tabsize);i++)
+ if ((*linep)->line[i] != ' ') {
+ tabsize = 1;
+ break;
+ }
+ // if in the middle of the space-tab
+ tabsize -= (*charp) % tabsize;
+ }
+ }
+
if (*charp== (*linep)->len) {
if ((*linep)->next) {
txt_move_down(text, sel);
*charp= 0;
}
} else {
- (*charp)++;
+ (*charp)+=tabsize;
}
undoing= oundoing;
if(!undoing) txt_undo_add_op(text, sel?UNDO_SRIGHT:UNDO_CRIGHT);
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index c80b2880d12..a67a61c7638 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -60,6 +60,7 @@
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
+#include "BKE_ocean.h"
#include "BKE_library.h"
#include "BKE_image.h"
@@ -71,6 +72,7 @@
#include "BKE_animsys.h"
#include "BKE_colortools.h"
+
/* ------------------------------------------------------------------------- */
/* All support for plugin textures: */
@@ -227,7 +229,7 @@ void default_tex_mapping(TexMapping *texmap)
void init_tex_mapping(TexMapping *texmap)
{
- float eul[3], smat[3][3], rmat[3][3], mat[3][3], proj[3][3];
+ 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 &&
is_zero_v3(texmap->loc) && is_zero_v3(texmap->rot) && is_one_v3(texmap->size)) {
@@ -250,10 +252,8 @@ void init_tex_mapping(TexMapping *texmap)
size_to_mat3(smat, texmap->size);
/* rotation */
- eul[0]= DEG2RADF(texmap->rot[0]);
- eul[1]= DEG2RADF(texmap->rot[1]);
- eul[2]= DEG2RADF(texmap->rot[2]);
- eul_to_mat3( rmat,eul);
+ /* TexMapping rotation are now in radians. */
+ eul_to_mat3(rmat, texmap->rot);
/* compose it all */
mul_m3_m3m3(mat, rmat, smat);
@@ -546,6 +546,7 @@ void free_texture(Tex *tex)
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);
@@ -628,6 +629,11 @@ void default_tex(Tex *tex)
tex->vd->interp_type=TEX_VD_LINEAR;
tex->vd->file_format=TEX_VD_SMOKE;
}
+
+ if (tex->ot) {
+ tex->ot->output = TEX_OCN_DISPLACEMENT;
+ tex->ot->object = NULL;
+ }
pit = tex->plugin;
if (pit) {
varstr= pit->varstr;
@@ -662,6 +668,10 @@ void tex_set_type(Tex *tex, int type)
if (tex->env == NULL)
tex->env = BKE_add_envmap();
break;
+ case TEX_OCEAN:
+ if (tex->ot == NULL)
+ tex->ot = BKE_add_oceantex();
+ break;
}
tex->type = type;
@@ -826,6 +836,7 @@ Tex *copy_texture(Tex *tex)
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) {
@@ -864,6 +875,9 @@ Tex *localize_texture(Tex *tex)
if(texn->vd->dataset)
texn->vd->dataset= MEM_dupallocN(texn->vd->dataset);
}
+ if(texn->ot) {
+ texn->ot= BKE_copy_oceantex(tex->ot);
+ }
texn->preview = NULL;
@@ -1039,7 +1053,7 @@ void autotexname(Tex *tex)
Main *bmain= G.main;
char texstr[20][15]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
"Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave",
- "Voronoi", "DistNoise", "Point Density", "Voxel Data", "", "", "", ""};
+ "Voronoi", "DistNoise", "Point Density", "Voxel Data", "Ocean", "", "", ""};
Image *ima;
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
@@ -1469,6 +1483,7 @@ void BKE_free_pointdensity(PointDensity *pd)
MEM_freeN(pd);
}
+/* ------------------------------------------------------------------------- */
void BKE_free_voxeldatadata(struct VoxelData *vd)
{
@@ -1513,6 +1528,31 @@ struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd)
return vdn;
}
+/* ------------------------------------------------------------------------- */
+
+struct OceanTex *BKE_add_oceantex(void)
+{
+ OceanTex *ot;
+
+ ot= MEM_callocN(sizeof(struct OceanTex), "ocean texture");
+ ot->output = TEX_OCN_DISPLACEMENT;
+ ot->object = NULL;
+
+ return ot;
+}
+
+struct OceanTex *BKE_copy_oceantex(struct OceanTex *ot)
+{
+ OceanTex *otn= MEM_dupallocN(ot);
+
+ return otn;
+}
+
+void BKE_free_oceantex(struct OceanTex *ot)
+{
+ MEM_freeN(ot);
+}
+
/* ------------------------------------------------------------------------- */
int BKE_texture_dependsOnTime(const struct Tex *texture)
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 65b27f725bc..49e6d598ea2 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -47,6 +47,7 @@
#include "BLI_listbase.h"
#include "BLI_ghash.h"
#include "BLI_path_util.h"
+#include "BLI_string.h"
#include "BKE_global.h"
#include "BKE_tracking.h"
@@ -119,10 +120,6 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event)
}
}
else if(event==CLAMP_SEARCH_DIM) {
- float max_pyramid_level_factor = 1.0;
- if (track->tracker == TRACKER_KLT) {
- max_pyramid_level_factor = 1 << (track->pyramid_levels - 1);
- }
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]);
@@ -145,7 +142,6 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event)
}
}
}
-
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);
@@ -618,18 +614,23 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
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, wndy;
/* compute the maximum pyramid size */
- double search_to_pattern_ratio= MIN2(search_size_x, search_size_y)
+ float search_to_pattern_ratio= MIN2(search_size_x, search_size_y)
/ MAX2(pattern_size_x, pattern_size_y);
- double log2_search_to_pattern_ratio = log(floor(search_to_pattern_ratio)) / M_LN2;
+ 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_context->track->pyramid_levels, max_pyramid_levels);
- track_context->region_tracker= libmv_regionTrackerNew(100, level);
+
+ wndx= (int)((track->pat_max[0]-track->pat_min[0])*width)/2;
+ wndy= (int)((track->pat_max[1]-track->pat_min[1])*height)/2;
+
+ track_context->region_tracker= libmv_regionTrackerNew(100, level, MAX2(wndx, wndy));
}
else if(track_context->track->tracker==TRACKER_SAD) {
/* nothing to initialize */
@@ -879,7 +880,7 @@ static ImBuf *get_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTra
while(a>=0 && a<track->markersnr) {
int next= (context->backwards) ? a+1 : a-1;
int is_keyframed= 0;
- MovieTrackingMarker *marker= &track->markers[a];
+ MovieTrackingMarker *cur_marker= &track->markers[a];
MovieTrackingMarker *next_marker= NULL;
if(next>=0 && next<track->markersnr)
@@ -889,11 +890,11 @@ static ImBuf *get_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTra
if(next_marker && next_marker->flag&MARKER_DISABLED)
is_keyframed= 1;
- is_keyframed|= (marker->flag&MARKER_TRACKED)==0;
+ is_keyframed|= (cur_marker->flag&MARKER_TRACKED)==0;
if(is_keyframed) {
- framenr= marker->framenr;
- *marker_keyed= marker;
+ framenr= cur_marker->framenr;
+ *marker_keyed= cur_marker;
break;
}
@@ -1079,7 +1080,6 @@ int BKE_tracking_next(MovieTrackingContext *context)
onbound= 1;
}
else if(track_context->track->tracker==TRACKER_KLT) {
- int wndx, wndy;
float *patch_new;
if(need_readjust) {
@@ -1102,11 +1102,8 @@ int BKE_tracking_next(MovieTrackingContext *context)
x2= pos[0];
y2= pos[1];
- wndx= (int)((track->pat_max[0]-track->pat_min[0])*ibuf_new->x)/2;
- wndy= (int)((track->pat_max[1]-track->pat_min[1])*ibuf_new->y)/2;
-
tracked= libmv_regionTrackerTrack(track_context->region_tracker, track_context->patch, patch_new,
- width, height, MAX2(wndx, wndy), x1, y1, &x2, &y2);
+ width, height, x1, y1, &x2, &y2);
MEM_freeN(patch_new);
}
@@ -1260,15 +1257,38 @@ static struct libmv_Tracks *create_libmv_tracks(MovieTracking *tracking, int wid
return tracks;
}
-static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction)
+static void retrieve_libmv_reconstruct_intrinscis(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction)
+{
+ struct libmv_CameraIntrinsics *libmv_intrinsics = libmv_ReconstructionExtractIntrinsics(libmv_reconstruction);
+
+ 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);
+
+ 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;
+}
+
+static int retrieve_libmv_reconstruct_tracks(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction)
{
int tracknr= 0;
int sfra= INT_MAX, efra= INT_MIN, a, origin_set= 0;
MovieTrackingTrack *track;
MovieTrackingReconstruction *reconstruction= &tracking->reconstruction;
MovieReconstructedCamera *reconstructed;
- float origin[3]= {0.0f, 0.0f, 0.0f};
int ok= 1;
+ float imat[4][4];
+
+ unit_m4(imat);
track= tracking->tracks.first;
while(track) {
@@ -1289,8 +1309,27 @@ static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reco
}
if(track->markersnr) {
- if(track->markers[0].framenr<sfra) sfra= track->markers[0].framenr;
- if(track->markers[track->markersnr-1].framenr>efra) efra= track->markers[track->markersnr-1].framenr;
+ int first= 0, last= track->markersnr;
+ 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) {
+ first++;
+ first_marker++;
+ }
+
+ /* find last not-disabled marker */
+ while(last>=0 && last_marker->flag&MARKER_DISABLED) {
+ last--;
+ last_marker--;
+ }
+
+ if(first<track->markersnr-1)
+ sfra= MIN2(sfra, first_marker->framenr);
+
+ if(last>=0)
+ efra= MAX2(efra, last_marker->framenr);
}
track= track->next;
@@ -1317,12 +1356,13 @@ static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reco
mat[i][j]= matd[i][j];
if(!origin_set) {
- copy_v3_v3(origin, mat[3]);
+ copy_m4_m4(imat, mat);
+ invert_m4(imat);
origin_set= 1;
}
if(origin_set)
- sub_v3_v3(mat[3], origin);
+ mul_m4_m4m4(mat, mat, imat);
copy_m4_m4(reconstructed[reconstruction->camnr].mat, mat);
reconstructed[reconstruction->camnr].framenr= a;
@@ -1343,7 +1383,7 @@ static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reco
track= tracking->tracks.first;
while(track) {
if(track->flag&TRACK_HAS_BUNDLE)
- sub_v3_v3(track->bundle_pos, origin);
+ mul_v3_m4v3(track->bundle_pos, imat, track->bundle_pos);
track= track->next;
}
@@ -1354,7 +1394,69 @@ static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reco
return ok;
}
+static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction)
+{
+ /* take the intrinscis back from libmv */
+ retrieve_libmv_reconstruct_intrinscis(tracking, libmv_reconstruction);
+
+ return retrieve_libmv_reconstruct_tracks(tracking, libmv_reconstruction);
+}
+
+static int get_refine_intrinsics_flags(MovieTracking *tracking)
+{
+ int refine= tracking->settings.refine_camera_intrinsics;
+ int flags= 0;
+
+ if(refine&REFINE_FOCAL_LENGTH)
+ flags|= LIBMV_REFINE_FOCAL_LENGTH;
+
+ 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_K2)
+ flags|= REFINE_RADIAL_DISTORTION_K2;
+
+ return flags;
+}
+
+static int count_tracks_on_both_keyframes(MovieTracking *tracking)
+{
+ int tot= 0;
+ int frame1= tracking->settings.keyframe1, frame2= tracking->settings.keyframe2;
+ MovieTrackingTrack *track;
+
+ track= tracking->tracks.first;
+ while(track) {
+ if(BKE_tracking_has_marker(track, frame1))
+ if(BKE_tracking_has_marker(track, frame2))
+ tot++;
+
+ track= track->next;
+ }
+
+ return tot;
+}
+#endif
+
+int BKE_tracking_can_solve(MovieTracking *tracking, char *error_msg, int error_size)
+{
+#if WITH_LIBMV
+ if(count_tracks_on_both_keyframes(tracking)<8) {
+ BLI_strncpy(error_msg, "At least 8 tracks on both of keyframes are needed for reconstruction", error_size);
+ return 0;
+ }
+
+ return 1;
+#else
+ BLI_strncpy(error_msg, "Blender is compiled without motion tracking library", error_size);
+ (void)tracking;
+
+ return 0;
#endif
+}
float BKE_tracking_solve_reconstruction(MovieTracking *tracking, int width, int height)
{
@@ -1365,6 +1467,7 @@ float BKE_tracking_solve_reconstruction(MovieTracking *tracking, int width, int
struct libmv_Tracks *tracks= create_libmv_tracks(tracking, width, height*aspy);
struct libmv_Reconstruction *reconstruction = libmv_solveReconstruction(tracks,
tracking->settings.keyframe1, tracking->settings.keyframe2,
+ get_refine_intrinsics_flags(tracking),
camera->focal,
camera->principal[0], camera->principal[1]*aspy,
camera->k1, camera->k2, camera->k3);
@@ -1774,7 +1877,7 @@ static void calculate_stabdata(MovieTracking *tracking, int framenr, float width
mul_v2_fl(loc, stab->locinf);
- if(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;
@@ -1816,7 +1919,8 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
track= tracking->tracks.first;
while(track) {
- if(track->flag&TRACK_USE_2D_STAB || track==stab->rot_track) {
+ if(track->flag&TRACK_USE_2D_STAB ||
+ ((stab->flag&TRACKING_STABILIZE_ROTATION) && track==stab->rot_track)) {
if(track->markersnr) {
sfra= MIN2(sfra, track->markers[0].framenr);
efra= MAX2(efra, track->markers[track->markersnr-1].framenr);
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 036a52a1235..3af724b4e30 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1066,13 +1066,13 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index,
if (!rd->ffcodecdata.properties) {
rd->ffcodecdata.properties
- = IDP_New(IDP_GROUP, val, "ffmpeg");
+ = IDP_New(IDP_GROUP, &val, "ffmpeg");
}
group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type);
if (!group) {
- group = IDP_New(IDP_GROUP, val, type);
+ group = IDP_New(IDP_GROUP, &val, type);
IDP_AddToGroup(rd->ffcodecdata.properties, group);
}
@@ -1102,7 +1102,9 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index,
idp_type = IDP_FLOAT;
break;
case FF_OPT_TYPE_STRING:
- val.str = (char *)" ";
+ val.string.str = (char *)" ";
+ val.string.len = 80;
+/* val.str = (char *)" ";*/
idp_type = IDP_STRING;
break;
case FF_OPT_TYPE_CONST:
@@ -1112,7 +1114,7 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index,
default:
return NULL;
}
- prop = IDP_New(idp_type, val, name);
+ prop = IDP_New(idp_type, &val, name);
IDP_AddToGroup(group, prop);
return prop;
}
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 99687ae8bb4..a2a4ffdc830 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -60,7 +60,8 @@ float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2]);
float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2]);
void closest_to_line_segment_v2(float closest[2], const float p[2], const float l1[2], const float l2[2]);
-float dist_to_plane_v3(const float p[2], const float plane_co[3], const float plane_no[2]);
+float dist_to_plane_normalized_v3(const float p[3], const float plane_co[3], const float plane_no_unit[3]);
+float dist_to_plane_v3(const float p[3], const float plane_co[3], const float plane_no[3]);
float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]);
@@ -92,14 +93,17 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
* */
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]);
+ const float v3[3], const float v4[3],
+ float i1[3], float i2[3]);
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 *lambda);
+ 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)*/
-int isect_ray_plane_v3(float p1[3], float d[3], float v0[3],
- float v1[3], float v2[3], float *lambda, int clip);
+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.
@@ -113,15 +117,30 @@ int isect_ray_plane_v3(float p1[3], float d[3], float v0[3],
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);
+/**
+ * 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.
+ */
+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]);
+
/* line/ray triangle */
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 *lambda, float uv[2]);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]);
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 *lambda, float uv[2]);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]);
int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
- const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float threshold);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float threshold);
int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3],
- const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float epsilon);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon);
/* point in polygon */
int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]);
@@ -131,16 +150,16 @@ int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y
int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]);
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 *uv);
+ 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 *uv);
+ const float v3[2], const float pt[2], float r_uv[2]);
/* other */
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 *lambda, float ipoint[3]);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]);
int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3],
- const float v0[3], const float v1[3], const float v2[3], float *lambda);
+ const float v0[3], const float v1[3], const float v2[3], float *r_lambda);
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
@@ -167,7 +186,7 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3],
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2],
const float co[2], float w[3]);
-void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2]);
+void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2]);
void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2]);
/***************************** View & Projection *****************************/
diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h
index 2a81966986f..f98919fadd3 100644
--- a/source/blender/blenlib/BLI_mempool.h
+++ b/source/blender/blenlib/BLI_mempool.h
@@ -34,12 +34,45 @@
* \brief Simple fast memory allocator.
*/
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
struct BLI_mempool;
+struct BLI_mempool_chunk;
+
+typedef struct BLI_mempool BLI_mempool;
+
+/*allow_iter allows iteration on this mempool. note: this requires that the
+ first four bytes of the elements never contain the character string
+ 'free'. use with care.*/
-struct BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmalloc);
-void *BLI_mempool_alloc(struct BLI_mempool *pool);
-void *BLI_mempool_calloc(struct BLI_mempool *pool);
-void BLI_mempool_free(struct BLI_mempool *pool, void *addr);
-void BLI_mempool_destroy(struct BLI_mempool *pool);
+BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk,
+ short use_sysmalloc, short allow_iter);
+void *BLI_mempool_alloc(BLI_mempool *pool);
+void *BLI_mempool_calloc(BLI_mempool *pool);
+void BLI_mempool_free(BLI_mempool *pool, void *addr);
+void BLI_mempool_destroy(BLI_mempool *pool);
+int BLI_mempool_count(BLI_mempool *pool);
+
+/** iteration stuff. note: this may easy to produce bugs with **/
+/*private structure*/
+typedef struct BLI_mempool_iter {
+ BLI_mempool *pool;
+ struct BLI_mempool_chunk *curchunk;
+ int curindex;
+} BLI_mempool_iter;
+
+/*allow iteration on this mempool. note: this requires that the
+ first four bytes of the elements never contain the character string
+ 'free'. use with care.*/
+void BLI_mempool_allow_iter(BLI_mempool *pool);
+void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter);
+void *BLI_mempool_iterstep(BLI_mempool_iter *iter);
+
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 080dc77fc06..c1894088300 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -60,7 +60,7 @@ GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) {
GHash *gh= MEM_mallocN(sizeof(*gh), info);
gh->hashfp= hashfp;
gh->cmpfp= cmpfp;
- gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0);
+ gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, FALSE, FALSE);
gh->cursize= 0;
gh->nentries= 0;
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index b4dc5b73a65..19ae89da8ea 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -20,7 +20,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Geoffery Bantle
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -29,69 +29,112 @@
* \ingroup bli
*/
-
/*
- Simple, fast memory allocator for allocating many elements of the same size.
-*/
+ * Simple, fast memory allocator for allocating many elements of the same size.
+ */
+
+#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
+
+#include "BLI_mempool.h" /* own include */
+
+#include "DNA_listBase.h"
#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-#include "BLI_mempool.h"
-#include <string.h>
-typedef struct BLI_freenode{
+#include <string.h>
+#include <stdlib.h>
+
+/* note: copied from BKE_utildefines.h, dont 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) )
+#else
+/* Little Endian */
+# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+#endif
+
+#define FREEWORD MAKE_ID('f', 'r', 'e', 'e')
+
+typedef struct BLI_freenode {
struct BLI_freenode *next;
-}BLI_freenode;
+ int freeword; /* used to identify this as a freed node */
+} BLI_freenode;
-typedef struct BLI_mempool_chunk{
+typedef struct BLI_mempool_chunk {
struct BLI_mempool_chunk *next, *prev;
void *data;
-}BLI_mempool_chunk;
+} BLI_mempool_chunk;
-typedef struct BLI_mempool{
+struct BLI_mempool {
struct ListBase chunks;
- int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/
- struct BLI_freenode *free; /*free element list. Interleaved into chunk datas.*/
- int totalloc, totused; /*total number of elements allocated in total, and currently in use*/
- int use_sysmalloc;
-}BLI_mempool;
-
-BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmalloc)
-{ BLI_mempool *pool = NULL;
+ int esize, csize, pchunk; /* size of elements and chunks in bytes
+ * and number of elements per chunk*/
+ short use_sysmalloc, allow_iter;
+ /* 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*/
+};
+
+#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 *pool = NULL;
BLI_freenode *lasttail = NULL, *curnode = NULL;
int i,j, maxchunks;
char *addr;
-
- if (esize < sizeof(void*))
- esize = sizeof(void*);
-
+
+ if (esize < MEMPOOL_ELEM_SIZE_MIN)
+ esize = MEMPOOL_ELEM_SIZE_MIN;
+
/*allocate the pool structure*/
pool = use_sysmalloc ? malloc(sizeof(BLI_mempool)) : MEM_mallocN(sizeof(BLI_mempool), "memory pool");
- pool->esize = esize;
+ pool->esize = allow_iter ? MAX2(esize, sizeof(BLI_freenode)) : esize;
pool->use_sysmalloc = use_sysmalloc;
- pool->pchunk = pchunk;
+ 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++){
+ for (i=0; i < maxchunks; i++) {
BLI_mempool_chunk *mpchunk = use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
mpchunk->next = mpchunk->prev = NULL;
mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
BLI_addtail(&(pool->chunks), mpchunk);
- if(i==0) pool->free = mpchunk->data; /*start of the list*/
+ if (i==0) {
+ pool->free = mpchunk->data; /*start of the list*/
+ if (pool->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++){
+ 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->freeword = FREEWORD;
+ curnode->freeword = FREEWORD;
+ }
}
/*final pointer in the previously allocated chunk is wrong.*/
- if(lasttail) lasttail->next = mpchunk->data;
+ if (lasttail) {
+ lasttail->next = mpchunk->data;
+ if (pool->allow_iter)
+ lasttail->freeword = FREEWORD;
+ }
+
/*set the end of this chunks memoryy to the new tail for next iteration*/
lasttail = curnode;
@@ -101,15 +144,18 @@ BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmall
curnode->next = NULL;
return pool;
}
-void *BLI_mempool_alloc(BLI_mempool *pool){
+
+void *BLI_mempool_alloc(BLI_mempool *pool)
+{
void *retval=NULL;
- BLI_freenode *curnode=NULL;
- char *addr=NULL;
- int j;
pool->totused++;
- if(!(pool->free)){
+ if (!(pool->free)) {
+ 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");
mpchunk->next = mpchunk->prev = NULL;
@@ -117,10 +163,18 @@ void *BLI_mempool_alloc(BLI_mempool *pool){
BLI_addtail(&(pool->chunks), mpchunk);
pool->free = mpchunk->data; /*start of the list*/
+ if (pool->allow_iter)
+ pool->free->freeword = FREEWORD;
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) {
+ curnode->freeword = FREEWORD;
+ if (j != pool->pchunk-1)
+ curnode->next->freeword = FREEWORD;
+ }
}
curnode->next = NULL; /*terminate the list*/
@@ -128,25 +182,28 @@ void *BLI_mempool_alloc(BLI_mempool *pool){
}
retval = pool->free;
+ if (pool->allow_iter)
+ pool->free->freeword = 0x7FFFFFFF;
+
pool->free = pool->free->next;
//memset(retval, 0, pool->esize);
return retval;
}
-void *BLI_mempool_calloc(BLI_mempool *pool){
- void *retval=NULL;
- retval = BLI_mempool_alloc(pool);
+void *BLI_mempool_calloc(BLI_mempool *pool)
+{
+ void *retval= BLI_mempool_alloc(pool);
memset(retval, 0, pool->esize);
return retval;
}
-
-void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid!
+/* doesnt protect against double frees, dont be stupid! */
+void BLI_mempool_free(BLI_mempool *pool, void *addr)
+{
BLI_freenode *newhead = addr;
- BLI_freenode *curnode=NULL;
- char *tmpaddr=NULL;
- int i;
+ if (pool->allow_iter)
+ newhead->freeword = FREEWORD;
newhead->next = pool->free;
pool->free = newhead;
@@ -154,14 +211,18 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
/*nothing is in use; free all the chunks except the first*/
if (pool->totused == 0) {
- BLI_mempool_chunk *mpchunk=NULL, *first;
+ BLI_freenode *curnode=NULL;
+ char *tmpaddr=NULL;
+ int i;
+
+ BLI_mempool_chunk *mpchunk=NULL;
+ BLI_mempool_chunk *first= pool->chunks.first;
- 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);
+ for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+ if (pool->use_sysmalloc) free(mpchunk->data);
+ else MEM_freeN(mpchunk->data);
}
pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));
@@ -170,7 +231,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
pool->totalloc = pool->pchunk;
pool->free = first->data; /*start of the list*/
- for(tmpaddr = first->data, i=0; i < pool->pchunk; i++){
+ for (tmpaddr = first->data, i=0; i < pool->pchunk; i++) {
curnode = ((BLI_freenode*)tmpaddr);
tmpaddr += pool->esize;
curnode->next = (BLI_freenode*)tmpaddr;
@@ -179,18 +240,63 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
}
}
+void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
+{
+ if (!pool->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;
+}
+
+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;
+
+ 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;
+}
+
void BLI_mempool_destroy(BLI_mempool *pool)
{
BLI_mempool_chunk *mpchunk=NULL;
- if(pool->use_sysmalloc) {
- for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+
+ if (pool->use_sysmalloc) {
+ for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
free(mpchunk->data);
}
BLI_freelist(&(pool->chunks));
free(pool);
}
else {
- for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+ for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
MEM_freeN(mpchunk->data);
}
BLI_freelistN(&(pool->chunks));
diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c
index 72743e38d4c..4507d70e339 100644
--- a/source/blender/blenlib/intern/DLRB_tree.c
+++ b/source/blender/blenlib/intern/DLRB_tree.c
@@ -209,7 +209,7 @@ DLRBT_Node *BLI_dlrbTree_search_exact (DLRBT_Tree *tree, DLRBT_Comparator_FP cmp
}
}
- /* return the nearest matching node */
+ /* return the exactly matching node */
return (found == 1) ? (node) : (NULL);
}
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 2afa17cb4e1..80a5421aff3 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -132,7 +132,7 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char
void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
{
- BPathRemap_Data data= {0};
+ BPathRemap_Data data= {NULL};
if(basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
@@ -175,7 +175,7 @@ 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= {0};
+ BPathRemap_Data data= {NULL};
if(basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
@@ -281,7 +281,7 @@ 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= {0};
+ struct BPathFind_Data data= {NULL};
data.reports= reports;
BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir));
@@ -432,6 +432,10 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
ClothModifierData *clmd= (ClothModifierData*) md;
BPATH_TRAVERSE_POINTCACHE(clmd->ptcaches);
}
+ else if (md->type==eModifierType_Ocean) {
+ OceanModifierData *omd= (OceanModifierData*) md;
+ rewrite_path_fixed(omd->cachepath, visit_cb, absbase, bpath_user_data);
+ }
}
if (ob->soft) {
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index a135cb43882..9d42ee347d4 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -134,9 +134,9 @@ float area_poly_v3(int nr, float verts[][3], const float normal[3])
int a, px=0, py=1;
/* first: find dominant axis: 0==X, 1==Y, 2==Z */
- x= (float)fabs(normal[0]);
- y= (float)fabs(normal[1]);
- z= (float)fabs(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) {
@@ -238,7 +238,16 @@ void closest_to_line_segment_v3(float closest[3], const float v1[3], const float
}
/* signed distance from the point to the plane in 3D */
-float dist_to_plane_v3(const float p[2], const float plane_co[3], const float plane_no[2])
+float dist_to_plane_normalized_v3(const float p[3], const float plane_co[3], const float plane_no_unit[3])
+{
+ float plane_co_other[3];
+
+ add_v3_v3v3(plane_co_other, plane_co, plane_no_unit);
+
+ return line_point_factor_v3(p, plane_co, plane_co_other);
+}
+
+float dist_to_plane_v3(const float p[3], const float plane_co[3], const float plane_no[3])
{
float plane_no_unit[3];
float plane_co_other[3];
@@ -246,7 +255,7 @@ float dist_to_plane_v3(const float p[2], const float plane_co[3], const float pl
normalize_v3_v3(plane_no_unit, plane_no);
add_v3_v3v3(plane_co_other, plane_co, plane_no_unit);
- return -line_point_factor_v3(p, plane_co, plane_co_other);
+ return line_point_factor_v3(p, plane_co, plane_co_other);
}
/* distance v1 to line-piece v2-v3 in 3D */
@@ -601,7 +610,9 @@ int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2],
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 *lambda, float uv[2])
+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])
{
float p[3], s[3], d[3], e1[3], e2[3], q[3];
@@ -626,12 +637,12 @@ int isect_line_tri_v3(const float p1[3], const float p2[3], const float v0[3], c
v = f * dot_v3v3(d, q);
if ((v < 0.0f)||((u + v) > 1.0f)) return 0;
- *lambda = f * dot_v3v3(e2, q);
- if ((*lambda < 0.0f)||(*lambda > 1.0f)) return 0;
+ *r_lambda = f * dot_v3v3(e2, q);
+ if ((*r_lambda < 0.0f)||(*r_lambda > 1.0f)) return 0;
- if(uv) {
- uv[0]= u;
- uv[1]= v;
+ if(r_uv) {
+ r_uv[0]= u;
+ r_uv[1]= v;
}
return 1;
@@ -640,7 +651,9 @@ int isect_line_tri_v3(const float p1[3], const float p2[3], const float v0[3], c
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 *lambda, float uv[2])
+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;
@@ -665,18 +678,20 @@ int isect_ray_tri_v3(const float p1[3], const float d[3], const float v0[3], con
v = f * dot_v3v3(d, q);
if ((v < 0.0f)||((u + v) > 1.0f)) return 0;
- *lambda = f * dot_v3v3(e2, q);
- if ((*lambda < 0.0f)) 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(r_uv) {
+ r_uv[0]= u;
+ r_uv[1]= v;
}
return 1;
}
-int isect_ray_plane_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, int clip)
+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)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f;
@@ -700,13 +715,15 @@ int isect_ray_plane_v3(float p1[3], float d[3], float v0[3], float v1[3], float
/* v = f * dot_v3v3(d, q); */ /*UNUSED*/
- *lambda = f * dot_v3v3(e2, q);
- if (clip && (*lambda < 0.0f)) return 0;
+ *r_lambda = f * dot_v3v3(e2, q);
+ if (clip && (*r_lambda < 0.0f)) return 0;
return 1;
}
-int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float epsilon)
+int isect_ray_tri_epsilon_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 uv[2], const float epsilon)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
@@ -729,8 +746,8 @@ int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], const float v0
v = f * dot_v3v3(d, q);
if ((v < -epsilon)||((u + v) > 1.0f+epsilon)) return 0;
- *lambda = f * dot_v3v3(e2, q);
- if ((*lambda < 0.0f)) return 0;
+ *r_lambda = f * dot_v3v3(e2, q);
+ if ((*r_lambda < 0.0f)) return 0;
if(uv) {
uv[0]= u;
@@ -740,7 +757,9 @@ int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], const float v0
return 1;
}
-int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float *uv, const float threshold)
+int isect_ray_tri_threshold_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], const float threshold)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
@@ -757,8 +776,8 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], const float
sub_v3_v3v3(s, p1, v0);
cross_v3_v3v3(q, s, e1);
- *lambda = f * dot_v3v3(e2, q);
- if ((*lambda < 0.0f)) return 0;
+ *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);
@@ -782,9 +801,9 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], const float
return 0;
}
- if(uv) {
- uv[0]= u;
- uv[1]= v;
+ if(r_uv) {
+ r_uv[0]= u;
+ r_uv[1]= v;
}
return 1;
@@ -833,6 +852,19 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
}
}
+/* note: return normal isnt 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])
+{
+ float plane_a_co_other[3];
+ cross_v3_v3v3(r_isect_no, plane_a_no, plane_b_no); /* direction is simply the cross product */
+ cross_v3_v3v3(plane_a_co_other, plane_a_no, r_isect_no);
+ add_v3_v3(plane_a_co_other, plane_a_co);
+ isect_line_plane_v3(r_isect_co, plane_a_co, plane_a_co_other, plane_b_co, plane_b_no, FALSE);
+}
+
+
/* 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)
@@ -872,7 +904,10 @@ 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 *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;
@@ -939,14 +974,14 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
if(z <= 0.0f && (x >= 0.0f && y >= 0.0f))
{
//(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000){
- *lambda=t0;
+ *r_lambda=t0;
copy_v3_v3(ipoint,point);
return 1;
}
}
- *lambda=1.0f;
+ *r_lambda=1.0f;
/*---test points---*/
a=dot_v3v3(vel,vel);
@@ -956,7 +991,7 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *lambda, lambda))
+ if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
{
copy_v3_v3(ipoint,v0);
found_by_sweep=1;
@@ -967,7 +1002,7 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *lambda, lambda))
+ if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
{
copy_v3_v3(ipoint,v1);
found_by_sweep=1;
@@ -978,7 +1013,7 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *lambda, lambda))
+ if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
{
copy_v3_v3(ipoint,v2);
found_by_sweep=1;
@@ -999,13 +1034,13 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
+ if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
{
e=(edotv*newLambda-edotbv)/elen2;
if(e >= 0.0f && e <= 1.0f)
{
- *lambda = newLambda;
+ *r_lambda = newLambda;
copy_v3_v3(ipoint,e1);
mul_v3_fl(ipoint,e);
add_v3_v3(ipoint, v0);
@@ -1023,13 +1058,13 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
+ if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
{
e=(edotv*newLambda-edotbv)/elen2;
if(e >= 0.0f && e <= 1.0f)
{
- *lambda = newLambda;
+ *r_lambda = newLambda;
copy_v3_v3(ipoint,e2);
mul_v3_fl(ipoint,e);
add_v3_v3(ipoint, v0);
@@ -1052,13 +1087,13 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
+ if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
{
e=(edotv*newLambda-edotbv)/elen2;
if(e >= 0.0f && e <= 1.0f)
{
- *lambda = newLambda;
+ *r_lambda = newLambda;
copy_v3_v3(ipoint,e3);
mul_v3_fl(ipoint,e);
add_v3_v3(ipoint, v1);
@@ -1069,7 +1104,8 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
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 *lambda)
+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;
@@ -1106,9 +1142,9 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
if ((u < 0.0f) || ((u + v) > 1.0f)) return 0;
- *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 ((*lambda < 0.0f) || (*lambda > 1.0f)) return 0;
+ if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) return 0;
return 1;
}
@@ -1182,7 +1218,7 @@ int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3],
/* Intersection point strictly between the two lines
* 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 *lambda)
+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;
@@ -1216,12 +1252,9 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float
{
mul_v3_fl(a, f1);
add_v3_v3v3(vi, v1, a);
-
- if (lambda != NULL)
- {
- *lambda = f1;
- }
-
+
+ if (r_lambda) *r_lambda = f1;
+
return 1; /* intersection found */
}
else
@@ -1285,7 +1318,7 @@ float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2
}
/* 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 *uv)
+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;
@@ -1310,7 +1343,7 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
wtot = w1+w2;
/*w1 = w1/wtot;*/
/*w2 = w2/wtot;*/
- uv[0] = w1/wtot;
+ r_uv[0] = w1/wtot;
} else {
/* lines are parallel, lambda_cp_line_ex is 3d grrr */
/*printf("\tparallel1\n");*/
@@ -1332,7 +1365,7 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
v2d[1] = pt[1]-pt_on_line[1];
w2 = len_v2(v2d);
wtot = w1+w2;
- uv[0] = w1/wtot;
+ r_uv[0] = w1/wtot;
}
/* Same as above to calc the uv[1] value, alternate calculation */
@@ -1350,7 +1383,7 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
v2d[1] = y1-v1[1];
w2 = len_v2(v2d);
wtot = w1+w2;
- uv[1] = w1/wtot;
+ r_uv[1] = w1/wtot;
} else {
/* lines are parallel, lambda_cp_line_ex is 3d grrr */
/*printf("\tparallel2\n");*/
@@ -1373,23 +1406,23 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
v2d[1] = pt[1]-pt_on_line[1];
w2 = len_v2(v2d);
wtot = w1+w2;
- uv[1] = w1/wtot;
+ 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 *uv)
+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, uv);
+ isect_point_quad_uv_v2(v0, v1, v2, v3, pt, r_uv);
}
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] = uv[0];
- p1_3d[1] = p2_3d[1] = uv[1];
+ 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;
@@ -1406,7 +1439,7 @@ void isect_point_face_uv_v2(const int isquad, const float v0[2], const float 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, uv);
+ isect_line_tri_v3(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, r_uv);
}
}
@@ -1668,9 +1701,9 @@ static int barycentric_weights(const float v1[3], const float v2[3], const float
/* find best projection of face XY, XZ or YZ: barycentric weights of
the 2d projected coords are the same and faster to compute */
- xn= (float)fabs(n[0]);
- yn= (float)fabs(n[1]);
- zn= (float)fabs(n[2]);
+ xn= fabsf(n[0]);
+ yn= fabsf(n[1]);
+ zn= fabsf(n[2]);
if(zn>=xn && zn>=yn) {i= 0; j= 1;}
else if(yn>=xn && yn>=zn) {i= 0; j= 2;}
else {i= 1; j= 2;}
@@ -1972,7 +2005,7 @@ void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3
#define IS_ZERO(x) ((x>(-DBL_EPSILON) && x<DBL_EPSILON) ? 1 : 0)
/* Barycentric reverse */
-void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2])
+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
@@ -1984,13 +2017,13 @@ void resolve_tri_uv(float uv[2], const float st[2], const float st0[2], const fl
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]};
- uv[0]= (float)((d*x[0] - b*x[1])/det);
- uv[1]= (float)(((-c)*x[0] + a*x[1])/det);
- } else zero_v2(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 uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
+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]);
@@ -2008,25 +2041,25 @@ void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const f
const double denom= a - 2*b + fC;
// clear outputs
- zero_v2(uv);
+ zero_v2(r_uv);
if(IS_ZERO(denom)!=0) {
const double fDen= a-fC;
if(IS_ZERO(fDen)==0)
- uv[0]= (float)(a / fDen);
+ 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;
- 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 */
{
- const double denom_s= (1-uv[0])*(st0[0]-st3[0]) + uv[0]*(st1[0]-st2[0]);
- const double denom_t= (1-uv[0])*(st0[1]-st3[1]) + uv[0]*(st1[1]-st2[1]);
+ 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)) {
@@ -2035,7 +2068,7 @@ void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const f
}
if(IS_ZERO(denom)==0)
- uv[1]= (float) (( (1.0f-uv[0])*(st0[i]-st[i]) + uv[0]*(st1[i]-st[i]) ) / denom);
+ r_uv[1]= (float) (( (1.0f-r_uv[0])*(st0[i]-st[i]) + r_uv[0]*(st1[i]-st[i]) ) / denom);
}
}
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 1637cd16161..e4664798f5d 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1322,8 +1322,8 @@ void mat3_to_compatible_eulO(float eul[3], float oldrot[3], short order,float ma
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= 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)
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 1c7d131c750..4570bd5e99e 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -181,19 +181,19 @@ MINLINE void add_v4_fl(float r[4], float f)
r[3] += f;
}
-MINLINE void add_v2_v2(float *r, const float *a)
+MINLINE void add_v2_v2(float r[2], const float a[2])
{
r[0] += a[0];
r[1] += a[1];
}
-MINLINE void add_v2_v2v2(float *r, const float *a, const float *b)
+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];
}
-MINLINE void add_v3_v3(float *r, const float *a)
+MINLINE void add_v3_v3(float r[3], const float a[3])
{
r[0] += a[0];
r[1] += a[1];
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 7aa84523e9d..08d9dfaeb9e 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1414,6 +1414,10 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
}
}
+ if (path[a] != '.') {
+ a= path_len;
+ }
+
if(a + ext_len >= maxlen)
return 0;
@@ -1841,7 +1845,7 @@ const char *BLI_program_dir(void)
* @param fullname The full path to the temp directory
* @param userdir Directory specified in user preferences
*/
-void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
+static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
{
fullname[0] = '\0';
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1fc79080310..c96d7f7ffa1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -121,6 +121,7 @@
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_node.h" // for tree type defines
+#include "BKE_ocean.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_particle.h"
@@ -1979,7 +1980,7 @@ static void direct_link_nladata_strips(FileData *fd, ListBase *list)
/* strip's F-Modifiers */
link_list(fd, &strip->modifiers);
- direct_link_modifiers(fd, &strip->modifiers);
+ direct_link_fmodifiers(fd, &strip->modifiers);
}
}
@@ -3102,6 +3103,8 @@ static void lib_link_texture(FileData *fd, Main *main)
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->nodetree)
lib_link_ntree(fd, &tex->id, tex->nodetree);
@@ -3153,6 +3156,8 @@ static void direct_link_texture(FileData *fd, Tex *tex)
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)
direct_link_nodetree(fd, tex->nodetree);
@@ -4369,6 +4374,12 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
SWITCH_INT(mmd->bindcos[a])
}
}
+ else if (md->type==eModifierType_Ocean) {
+ OceanModifierData *omd = (OceanModifierData*) md;
+ omd->oceancache = NULL;
+ omd->ocean = NULL;
+ omd->refresh = (MOD_OCEAN_REFRESH_ADD|MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM);
+ }
else if (md->type==eModifierType_Warp) {
WarpModifierData *tmd = (WarpModifierData *) md;
@@ -4721,6 +4732,9 @@ static void lib_link_scene(FileData *fd, Main *main)
/*Game Settings: Dome Warp Text*/
sce->gm.dome.warptext= newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
+ /* Motion Tracking */
+ sce->clip= newlibadr_us(fd, sce->id.lib, sce->clip);
+
sce->id.flag -= LIB_NEEDLINK;
}
@@ -4932,8 +4946,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->nodetree= newdataadr(fd, sce->nodetree);
if(sce->nodetree)
direct_link_nodetree(fd, sce->nodetree);
-
- sce->clip= newlibadr_us(fd, sce->id.lib, sce->clip);
}
/* ************ READ WM ***************** */
@@ -7479,6 +7491,52 @@ static void do_version_ntree_tex_mapping_260(void *UNUSED(data), ID *UNUSED(id),
}
}
+static void do_versions_nodetree_convert_angle(bNodeTree *ntree)
+{
+ bNode *node;
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->type == CMP_NODE_ROTATE) {
+ /* Convert degrees to radians. */
+ bNodeSocket *sock = ((bNodeSocket*)node->inputs.first)->next;
+ ((bNodeSocketValueFloat*)sock->default_value)->value = DEG2RADF(((bNodeSocketValueFloat*)sock->default_value)->value);
+ }
+ else if (node->type == CMP_NODE_DBLUR) {
+ /* Convert degrees to radians. */
+ NodeDBlurData *ndbd= node->storage;
+ ndbd->angle = DEG2RADF(ndbd->angle);
+ ndbd->spin = DEG2RADF(ndbd->spin);
+ }
+ else if (node->type == CMP_NODE_DEFOCUS) {
+ /* Convert degrees to radians. */
+ NodeDefocus *nqd = node->storage;
+ /* XXX DNA char to float conversion seems to map the char value into the [0.0f, 1.0f] range... */
+ nqd->rotation = DEG2RADF(nqd->rotation*255.0f);
+ }
+ else if (node->type == CMP_NODE_CHROMA_MATTE) {
+ /* Convert degrees to radians. */
+ NodeChroma *ndc = node->storage;
+ ndc->t1 = DEG2RADF(ndc->t1);
+ ndc->t2 = DEG2RADF(ndc->t2);
+ }
+ else if (node->type == CMP_NODE_GLARE) {
+ /* Convert degrees to radians. */
+ NodeGlare* ndg = node->storage;
+ /* XXX DNA char to float conversion seems to map the char value into the [0.0f, 1.0f] range... */
+ ndg->angle_ofs = DEG2RADF(ndg->angle_ofs*255.0f);
+ }
+ /* XXX TexMapping struct is used by other nodes too (at least node_composite_mapValue),
+ * but not the rot part...
+ */
+ else if (node->type == SH_NODE_MAPPING) {
+ /* Convert degrees to radians. */
+ TexMapping* tmap = node->storage;
+ tmap->rot[0] = DEG2RADF(tmap->rot[0]);
+ tmap->rot[1] = DEG2RADF(tmap->rot[1]);
+ tmap->rot[2] = DEG2RADF(tmap->rot[2]);
+ }
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -9079,7 +9137,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if(sce->r.yparts<2) sce->r.yparts= 4;
/* adds default layer */
if(sce->r.layers.first==NULL)
- scene_add_render_layer(sce);
+ scene_add_render_layer(sce, NULL);
else {
SceneRenderLayer *srl;
/* new layer flag for sky, was default for solid */
@@ -12035,6 +12093,25 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+
+ /* put compatibility code here until next subversion bump */
+ if (main->versionfile < 255 || (main->versionfile == 255 && main->subversionfile < 3)) {
+ Object *ob;
+
+ /* ocean res is now squared, reset old ones - will be massive */
+ 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_Ocean) {
+ OceanModifierData *omd = (OceanModifierData *)md;
+ omd->resolution = 7;
+ omd->oceancache = NULL;
+ }
+ }
+ }
+ }
+
+ /* put compatibility code here until next subversion bump */
if (main->versionfile < 256) {
bScreen *sc;
@@ -12571,9 +12648,29 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_mapping_260);
}
- /* put compatibility code here until next subversion bump */
- {
+ if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 4)){
{
+ /* Convert node angles to radians! */
+ Scene *sce;
+ Material *mat;
+ bNodeTree *ntree;
+
+ for (sce=main->scene.first; sce; sce=sce->id.next) {
+ if (sce->nodetree)
+ do_versions_nodetree_convert_angle(sce->nodetree);
+ }
+
+ for (mat=main->mat.first; mat; mat=mat->id.next) {
+ if (mat->nodetree)
+ do_versions_nodetree_convert_angle(mat->nodetree);
+ }
+
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+ do_versions_nodetree_convert_angle(ntree);
+ }
+
+ {
+ /* Tomato compatibility code. */
bScreen *sc;
MovieClip *clip;
@@ -12634,6 +12731,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ /* put compatibility code here until next subversion bump */
+ {
+ }
+
/* default values in Freestyle settings */
{
Scene *sce;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 086b83d0962..5e985e64288 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1816,6 +1816,7 @@ static void write_textures(WriteData *wd, ListBase *idbase)
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);
/* nodetree is integral part of texture, no libdata */
if(tex->nodetree) {
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 198862e480d..422f80532a9 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1921,7 +1921,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
short selectmode=0;
- int gesture_mode;
+ int gesture_mode, extend;
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -1932,8 +1932,13 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
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)
+ ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_CLEAR);
+
if (gesture_mode == GESTURE_MODAL_SELECT)
selectmode = ACHANNEL_SETFLAG_ADD;
else
@@ -1967,7 +1972,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
/* ******************* Rename Operator ***************************** */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index aa1af231afd..cc1fae170d0 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1147,6 +1147,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
int xmax= RNA_int_get(op->ptr, "xmax");
int ymin= RNA_int_get(op->ptr, "ymin");
int ymax= RNA_int_get(op->ptr, "ymax");
+ int extend= RNA_boolean_get(op->ptr, "extend");
UI_view2d_region_to_view(v2d, xmin, ymin, &xminf, &yminf);
UI_view2d_region_to_view(v2d, xmax, ymax, &xmaxf, &ymaxf);
@@ -1166,6 +1167,9 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
break;
}
}
+ else if (!extend) {
+ marker->flag &= ~SELECT;
+ }
}
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
@@ -1198,7 +1202,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
/* *********************** (de)select all ***************** */
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 1f6673137a1..1415b8965fe 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -5468,6 +5468,24 @@ static int point_on_nurb(Nurb *nu, void *point)
}
}
+static Nurb *get_lastsel_nurb(Curve *cu)
+{
+ ListBase *nubase= curve_editnurbs(cu);
+ Nurb *nu= nubase->first;
+
+ if(!cu->lastsel)
+ return NULL;
+
+ while (nu) {
+ if (point_on_nurb(nu, cu->lastsel))
+ return nu;
+
+ nu= nu->next;
+ }
+
+ return NULL;
+}
+
static void select_nth_bezt(Nurb *nu, BezTriple *bezt, int nth)
{
int a, start;
@@ -5517,21 +5535,11 @@ static void select_nth_bp(Nurb *nu, BPoint *bp, int nth)
int CU_select_nth(Object *obedit, int nth)
{
Curve *cu= (Curve*)obedit->data;
- ListBase *nubase= curve_editnurbs(cu);
Nurb *nu;
- int ok=0;
-
- /* Search nurb to which selected point belongs to */
- nu= nubase->first;
- while (nu) {
- if (point_on_nurb(nu, cu->lastsel)) {
- ok= 1;
- break;
- }
- nu= nu->next;
- }
- if (!ok) return 0;
+ nu= get_lastsel_nurb(cu);
+ if (!nu)
+ return 0;
if (nu->bezt) {
select_nth_bezt(nu, cu->lastsel, nth);
@@ -7070,3 +7078,24 @@ void ED_curve_bpcpy(EditNurb *editnurb, BPoint *dst, BPoint *src, int count)
memcpy(dst, src, count*sizeof(BPoint));
keyIndex_updateBP(editnurb, src, dst, count);
}
+
+int ED_curve_actSelection(Curve *cu, float center[3])
+{
+ Nurb *nu= get_lastsel_nurb(cu);
+
+ if(!nu)
+ return 0;
+
+ if(nu->bezt) {
+ BezTriple *bezt= cu->lastsel;
+
+ copy_v3_v3(center, bezt->vec[1]);
+ }
+ else {
+ BPoint *bp= cu->lastsel;
+
+ copy_v3_v3(center, bp->vec);
+ }
+
+ return 1;
+}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 081d604819d..def6cd61370 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -794,7 +794,7 @@ void draw_gpencil_view3d (Scene *scene, View3D *v3d, ARegion *ar, short only3d)
* 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;
- ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, -1); /* negative shift */
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, TRUE); /* no shift */
BLI_copy_rcti_rctf(&rect, &rectf);
}
else {
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 65db5e27ed7..9a492153b7f 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -468,7 +468,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
Scene *scene= CTX_data_scene(C);
- ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, subrect, -1); /* negative shift */
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, subrect, TRUE); /* no shift */
return 1;
}
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index bd02df2ddba..f09797bf6f1 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -105,9 +105,9 @@ typedef struct tGPsdata {
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 */
+ * to region space */
- float custom_color[3]; /* custom color for */
+ float custom_color[4]; /* custom color for (?) */
} tGPsdata;
/* values for tGPsdata->status */
@@ -1258,7 +1258,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- ED_view3d_calc_camera_border(p->scene, p->ar, v3d, rv3d, &p->subrect_data, -1); /* negative shift */
+ ED_view3d_calc_camera_border(p->scene, p->ar, v3d, rv3d, &p->subrect_data, TRUE); /* no shift */
p->subrect= &p->subrect_data;
}
}
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 1f9b034b2e5..8f97d1c8602 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -89,6 +89,8 @@ void ED_curve_bpcpy(struct EditNurb *editnurb, struct BPoint *dst, struct BPoint
int ED_curve_updateAnimPaths(struct Object *obedit);
+int ED_curve_actSelection(struct Curve *cu, float center[3]);
+
/* debug only */
void printknots(struct Object *obedit);
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 37f647abfd9..2ca3e2bfe7f 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -183,10 +183,10 @@ typedef enum SnapMode
#define SNAP_MIN_DISTANCE 30
-int peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, float mval[2]);
-int peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, float mval[2]);
-int snapObjectsTransform(struct TransInfo *t, float mval[2], int *dist, float *loc, float *no, SnapMode mode);
-int snapObjectsContext(struct bContext *C, float mval[2], int *dist, float *loc, float *no, SnapMode mode);
+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 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);
#endif
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 82a1e6f1f00..c2390d41d8c 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -206,12 +206,12 @@ void project_int_noclip(struct ARegion *ar, const float vec[3], int adr[2]);
void project_float(struct ARegion *ar, const float vec[3], float adr[2]);
void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
-void ED_view3d_ob_clip_range_get(struct Object *ob, float *lens, float *clipsta, float *clipend);
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, float *pixsize);
+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(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 do_shift);
+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_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float size_r[2]);
/* drawobject.c iterators */
void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
@@ -290,6 +290,7 @@ void ED_view3d_camera_lock_init(struct View3D *v3d, struct RegionView3D *rv3d);
/* copy the view to the camera, return TRUE if */
int ED_view3d_camera_lock_sync(struct View3D *v3d, struct RegionView3D *rv3d);
-struct BGpic *ED_view3D_background_image_add(struct View3D *v3d);
+struct BGpic *ED_view3D_background_image_new(struct View3D *v3d);
+void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic);
#endif /* ED_VIEW3D_H */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 35fabb3b80e..a0b477413e4 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -592,7 +592,8 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname);
* not clear yet so we postpone that. */
void uiBeginPanels(const struct bContext *C, struct ARegion *ar);
-void uiEndPanels(const struct bContext *C, struct ARegion *ar);
+void uiEndPanels(const struct bContext *C, struct ARegion *ar, int *x, int *y);
+void uiDrawPanels(const struct bContext *C, struct ARegion *ar);
struct Panel *uiBeginPanel(struct ScrArea *sa, struct ARegion *ar, uiBlock *block, struct PanelType *pt, int *open);
void uiEndPanel(uiBlock *block, int width, int height);
@@ -688,6 +689,7 @@ void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv);
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr);
const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, struct wmOperator *op, int (*check_prop)(struct PropertyRNA *), const char label_align, const short flag);
+struct MenuType *uiButGetMenuType(uiBut *but);
void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);
void uiLayoutSetActive(uiLayout *layout, int active);
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 44eb136750b..e739417519f 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -320,6 +320,9 @@ void UI_ThemeClearColor(int colorid);
// internal (blender) usage only, for init and set active
void UI_SetTheme(int spacetype, int regionid);
+// get current theme
+struct bTheme *UI_GetTheme(void);
+
/* only for buttons in theme editor! */
const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 81b42277055..4b7adbc1064 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -48,6 +48,8 @@
#include "BKE_context.h"
#include "BKE_library.h"
#include "BKE_unit.h"
+#include "BKE_screen.h"
+#include "BKE_idprop.h"
#include "BKE_utildefines.h" /* FILE_MAX */
#include "BIF_gl.h"
@@ -793,26 +795,61 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
{
uiBut *but;
- IDProperty *prop;
char buf[512];
+ /* for menu's */
+ MenuType *mt;
+ IDProperty *prop_menu= NULL;
+ IDProperty *prop_menu_name= NULL;
+
/* only do it before bounding */
if(block->minx != block->maxx)
return;
+
+#define UI_MENU_KEY_STR_CAT \
+ char *butstr_orig= BLI_strdup(but->str); \
+ BLI_snprintf(but->strdata, \
+ sizeof(but->strdata), \
+ "%s|%s", \
+ butstr_orig, buf); \
+ MEM_freeN(butstr_orig); \
+ but->str= but->strdata; \
+ ui_check_but(but); \
+
+
for(but=block->buttons.first; but; but=but->next) {
if(but->optype) {
- prop= (but->opptr)? but->opptr->data: NULL;
-
- if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) {
- char *butstr_orig= BLI_strdup(but->str);
- BLI_snprintf(but->strdata, sizeof(but->strdata), "%s|%s", butstr_orig, buf);
- MEM_freeN(butstr_orig);
- but->str= but->strdata;
- ui_check_but(but);
+ 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))) {
+ UI_MENU_KEY_STR_CAT
}
}
+ 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))));
+ }
+
+ 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))) {
+ UI_MENU_KEY_STR_CAT
+ }
+ }
+ }
+
+ if (prop_menu) {
+ IDP_FreeProperty(prop_menu);
+ MEM_freeN(prop_menu);
}
+
+#undef UI_MENU_KEY_STR_CAT
+
}
void uiEndBlock(const bContext *C, uiBlock *block)
@@ -2581,11 +2618,8 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
else
BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value);
- if(value == item[i].value) {
+ if(value == item[i].value)
icon= item[i].icon;
- if(!tip)
- tip= item[i].description;
- }
}
str= BLI_dynstr_get_cstring(dynstr);
BLI_dynstr_free(dynstr);
@@ -3545,7 +3579,7 @@ void UI_init_userdef(void)
uiStyleInit();
}
-void UI_reinit_font()
+void UI_reinit_font(void)
{
uiStyleInit();
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 1edd43d4e01..5e095bae922 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -164,24 +164,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* set the expression */
// TODO: need some way of identifying variables used
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
-
- /* FIXME: for now, assume that
- * - for expressions, users are likely to be using "frame" -> current frame" as a variable
- * - driver_add_new_variable() adds a single-prop variable by default
- */
- {
- DriverVar *dvar;
- DriverTarget *dtar;
-
- dvar = driver_add_new_variable(driver);
- BLI_strncpy(dvar->name, "frame", sizeof(dvar->name));
-
- dtar = &dvar->targets[0];
- dtar->id = (ID *)CTX_data_scene(C); // XXX: should we check that C is valid first?
- dtar->idtype= ID_SCE;
- dtar->rna_path = BLI_sprintfN("frame_current");
- }
-
+
/* updates */
driver->flag |= DRIVER_FLAG_RECOMPILE;
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME, NULL);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 7338aa1983f..688e8f95ac7 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -271,7 +271,7 @@ int ui_is_but_utf8(uiBut *but)
{
if (but->rnaprop) {
const int subtype= RNA_property_subtype(but->rnaprop);
- return !(ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME));
+ return !(ELEM4(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING));
}
else {
return !(but->flag & UI_BUT_NO_UTF8);
@@ -4357,7 +4357,7 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
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, buf, sizeof(buf))) {
+ if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) {
char *butstr_orig;
// XXX but->str changed... should not, remove the hotkey from it
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 089458f1da4..1b7308d328e 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -506,7 +506,7 @@ static void init_brush_icons(void)
static void init_internal_icons(void)
{
- bTheme *btheme= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
ImBuf *bbuf= NULL;
int x, y, icontype;
char iconfilestr[FILE_MAXDIR+FILE_MAXFILE];
@@ -950,6 +950,7 @@ 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();
Icon *icon = NULL;
DrawInfo *di = NULL;
IconImage *iimg;
@@ -957,6 +958,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
int w, h;
icon = BKE_icon_get(icon_id);
+ alpha *= btheme->tui.icon_alpha;
if (icon==NULL) {
if (G.f & G_DEBUG)
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 16e0153b910..d6460f9046e 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -112,7 +112,7 @@ typedef enum {
/* internal panel drawing defines */
#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */
-#define PNL_HEADER UI_UNIT_Y /* 20 default */
+#define PNL_HEADER (UI_UNIT_Y + 4) /* 24 default */
/* panel->flag */
#define PNL_SELECT 1
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 32bcfe51afc..c553c1e35ad 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -677,7 +677,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i
}
else {
IDPropertyTemplate val = {0};
- opptr->data= IDP_New(IDP_GROUP, val, "wmOperatorProperties");
+ opptr->data= IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
}
return *opptr;
@@ -1370,7 +1370,7 @@ static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
mt->draw(C, &menu);
}
-static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN)
+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;
uiBut *but;
@@ -1393,11 +1393,11 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre
w -= 10;
if(name[0] && icon)
- but= uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, "");
+ 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, "");
+ but= uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip);
else
- but= uiDefMenuBut(block, func, arg, name, 0, 0, w, h, "");
+ but= uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip);
if(argN) { /* ugly .. */
but->poin= (char*)but;
@@ -1430,7 +1430,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL);
+ ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL, mt->description);
}
/* label item */
@@ -1492,11 +1492,11 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
w= ui_text_icon_width(layout, name, icon, 0);
if(icon && name[0])
- uiDefIconTextButF(block, BUTM, 0, icon, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, "");
+ uiDefIconTextButF(block, BUT, argval, icon, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
else if(icon)
- uiDefIconButF(block, BUTM, 0, icon, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, "");
+ uiDefIconButF(block, BUT, argval, icon, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
else
- uiDefButF(block, BUTM, 0, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, "");
+ uiDefButF(block, BUT, argval, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
}
/* separator item */
@@ -1514,7 +1514,7 @@ void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc
if(!func)
return;
- ui_item_menu(layout, name, icon, func, arg, NULL);
+ ui_item_menu(layout, name, icon, func, arg, NULL, "");
}
typedef struct MenuItemLevel {
@@ -1560,7 +1560,7 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
lvl->opcontext= layout->root->opcontext;
- ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl);
+ 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)
@@ -1593,7 +1593,7 @@ void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propn
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
lvl->opcontext= layout->root->opcontext;
- ui_item_menu(layout, name, icon, menu_item_enum_rna_menu, NULL, lvl);
+ ui_item_menu(layout, name, icon, menu_item_enum_rna_menu, NULL, lvl, RNA_property_description(prop));
}
/**************************** Layout Items ***************************/
@@ -2517,7 +2517,7 @@ static void ui_item_layout(uiItem *item)
static void ui_layout_end(uiBlock *block, uiLayout *layout, int *x, int *y)
{
if(layout->root->handlefunc)
- uiBlockSetButmFunc(block, layout->root->handlefunc, layout->root->argv);
+ uiBlockSetHandleFunc(block, layout->root->handlefunc, layout->root->argv);
ui_item_estimate(&layout->item);
ui_item_layout(&layout->item);
@@ -2747,7 +2747,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
{
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) {
@@ -2821,3 +2821,14 @@ 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) {
+ return (MenuType *)but->poin;
+ }
+ else {
+ return NULL;
+ }
+}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 5803054caa7..2a75c2a26c1 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -494,7 +494,7 @@ struct uiEditSourceButStore {
} uiEditSourceButStore;
/* should only ever be set while the edit source operator is running */
-struct uiEditSourceStore *ui_editsource_info= NULL;
+static struct uiEditSourceStore *ui_editsource_info= NULL;
int UI_editsource_enable_check(void)
{
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index aa80cb632ec..d66e6852f1d 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -59,6 +59,7 @@
#include "ED_screen.h"
#include "UI_interface.h"
+#include "UI_resources.h"
#include "interface_intern.h"
@@ -173,7 +174,6 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open)
{
- uiStyle *style= UI_GetStyle();
Panel *pa, *patab, *palast, *panext;
char *drawname= pt->label;
char *idname= pt->idname;
@@ -208,7 +208,7 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int
}
pa->ofsx= 0;
- pa->ofsy= style->panelouter;
+ pa->ofsy= 0;
pa->sizex= 0;
pa->sizey= 0;
pa->runtime_flag |= PNL_NEW_ADDED;
@@ -482,6 +482,7 @@ static void rectf_scale(rctf *rect, float scale)
/* 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;
rcti headrect;
rctf itemrect;
@@ -493,19 +494,37 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
/* calculate header rect */
/* + 0.001f to prevent flicker due to float inaccuracy */
headrect= *rect;
- headrect.ymin= headrect.ymax;
+ headrect.ymin= headrect.ymax - 2.0f/block->aspect;
headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f);
- if(!(panel->runtime_flag & PNL_FIRST)) {
- float minx= rect->xmin+5.0f/block->aspect;
- float maxx= rect->xmax-5.0f/block->aspect;
+ {
+ float minx= rect->xmin;
+ float maxx= rect->xmax;
float y= headrect.ymax;
-
+
glEnable(GL_BLEND);
- glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
- fdrawline(minx, y+1, maxx, y+1);
- glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
- fdrawline(minx, y, maxx, y);
+
+ if(btheme->tui.panel.show_header) {
+ /* draw with background color */
+ glEnable(GL_BLEND);
+ glColor4ubv((unsigned char*)btheme->tui.panel.header);
+ glRectf(minx, headrect.ymin, maxx, y);
+
+ fdrawline(minx, y, maxx, y);
+ fdrawline(minx, y, maxx, y);
+ }
+ else if(!(panel->runtime_flag & PNL_FIRST)) {
+ /* draw embossed separator */
+ minx += 5.0f/block->aspect;
+ maxx -= 5.0f/block->aspect;
+
+ glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
+ fdrawline(minx, y+1, maxx, y+1);
+ glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
+ fdrawline(minx, y, maxx, y);
+ glDisable(GL_BLEND);
+ }
+
glDisable(GL_BLEND);
}
@@ -518,7 +537,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
itemrect.xmin= itemrect.xmax - (headrect.ymax-headrect.ymin);
itemrect.ymin= headrect.ymin;
itemrect.ymax= headrect.ymax;
- rectf_scale(&itemrect, 0.8f);
+
+ rectf_scale(&itemrect, 0.7f);
ui_draw_panel_dragwidget(&itemrect);
}
@@ -538,7 +558,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
/* in some occasions, draw a border */
if(panel->flag & PNL_SELECT) {
if(panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL);
- else uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
+ 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);
@@ -567,7 +587,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
itemrect.ymin= headrect.ymin;
itemrect.ymax= headrect.ymax;
- rectf_scale(&itemrect, 0.5f);
+ rectf_scale(&itemrect, 0.35f);
if(panel->flag & PNL_CLOSEDY)
ui_draw_tria_rect(&itemrect, 'h');
@@ -589,12 +609,12 @@ static int get_panel_header(Panel *pa)
return PNL_HEADER;
}
-static int get_panel_size_y(uiStyle *style, Panel *pa)
+static int get_panel_size_y(Panel *pa)
{
if(pa->type && (pa->type->flag & PNL_NO_HEADER))
return pa->sizey;
- return PNL_HEADER + pa->sizey + style->panelouter;
+ return PNL_HEADER + pa->sizey;
}
/* this function is needed because uiBlock and Panel itself dont
@@ -667,7 +687,6 @@ static int compare_panel(const void *a1, const void *a2)
/* returns 1 when it did something */
static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
{
- uiStyle *style= UI_GetStyle();
Panel *pa;
PanelSort *ps, *panelsort, *psnext;
int a, tot=0, done;
@@ -719,18 +738,18 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
/* 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(style, ps->pa);
+ 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(style, psnext->pa);
+ 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(style, ps->pa) - get_panel_size_y(style, psnext->pa);
+ psnext->pa->ofsy= ps->pa->ofsy + get_panel_size_y(ps->pa) - get_panel_size_y(psnext->pa);
}
}
@@ -760,6 +779,35 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
return done;
}
+static void ui_panels_size(ScrArea *sa, ARegion *ar, int *x, int *y)
+{
+ Panel *pa;
+ 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) {
+ int pa_sizex, pa_sizey;
+
+ 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);
+ }
+
+ sizex= MAX2(sizex, pa_sizex);
+ sizey= MIN2(sizey, pa_sizey);
+ }
+ }
+
+ *x= sizex;
+ *y= sizey;
+}
static void ui_do_animate(const bContext *C, Panel *panel)
{
@@ -799,7 +847,7 @@ void uiBeginPanels(const bContext *UNUSED(C), ARegion *ar)
}
/* only draws blocks with panels */
-void uiEndPanels(const bContext *C, ARegion *ar)
+void uiEndPanels(const bContext *C, ARegion *ar, int *x, int *y)
{
ScrArea *sa= CTX_wm_area(C);
uiBlock *block;
@@ -852,6 +900,14 @@ void uiEndPanels(const bContext *C, ARegion *ar)
if(firstpa)
firstpa->runtime_flag |= PNL_FIRST;
+
+ /* compute size taken up by panel */
+ ui_panels_size(sa, ar, x, y);
+}
+
+void uiDrawPanels(const bContext *C, ARegion *ar)
+{
+ uiBlock *block;
UI_ThemeClearColor(TH_BACK);
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 34b62155314..47dde3f03f0 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -376,17 +376,18 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
data->totline++;
}
- if(but->type == ROW) {
+ if(ELEM(but->type, ROW, MENU)) {
EnumPropertyItem *item;
int i, totitem, free;
+ 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 == (int)but->hardmax) {
+ if(item[i].identifier[0] && item[i].value == value) {
if(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]= 0xFFFFFF;
+ data->color[data->totline]= 0xDDDDDD;
data->totline++;
}
break;
@@ -398,7 +399,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
}
}
- if(but->tip && strlen(but->tip)) {
+ 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->totline++;
@@ -408,7 +409,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* operator keymap (not menus, they already have it) */
prop= (but->opptr)? but->opptr->data: NULL;
- if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, 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->totline++;
@@ -493,8 +494,8 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
}
else if (ELEM(but->type, MENU, PULLDOWN)) {
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
- if(but->menu_create_func && WM_menutype_contains((MenuType *)but->poin)) {
- MenuType *mt= (MenuType *)but->poin;
+ 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->totline++;
@@ -1446,6 +1447,8 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
void ui_popup_block_scrolltest(uiBlock *block)
{
uiBut *bt;
+ /* 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);
@@ -1462,9 +1465,9 @@ void ui_popup_block_scrolltest(uiBlock *block)
block->flag |= UI_BLOCK_CLIPBOTTOM;
/* make space for arrow */
if(bt->y2 < block->miny +10) {
- if(bt->next && bt->next->y1 > bt->y1)
+ if(is_flip && bt->next && bt->next->y1 > bt->y1)
bt->next->flag |= UI_SCROLLED;
- if(bt->prev && bt->prev->y1 > bt->y1)
+ else if(!is_flip && bt->prev && bt->prev->y1 > bt->y1)
bt->prev->flag |= UI_SCROLLED;
}
}
@@ -1473,9 +1476,9 @@ void ui_popup_block_scrolltest(uiBlock *block)
block->flag |= UI_BLOCK_CLIPTOP;
/* make space for arrow */
if(bt->y1 > block->maxy -10) {
- if(bt->next && bt->next->y2 < bt->y2)
+ if(!is_flip && bt->next && bt->next->y2 < bt->y2)
bt->next->flag |= UI_SCROLLED;
- if(bt->prev && bt->prev->y2 < bt->y2)
+ else if(is_flip && bt->prev && bt->prev->y2 < bt->y2)
bt->prev->flag |= UI_SCROLLED;
}
}
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 0e9dbaf3022..3caafe308d0 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -124,7 +124,6 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->buttonspacex= 8;
style->buttonspacey= 2;
style->panelspace= 8;
- style->panelouter= 4;
return style;
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6e51443fc8d..1cd6ccc19cd 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2458,7 +2458,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
/* check for hotkey */
if(len < 256-6) {
- if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1))
+ if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, &name[len+1], 256-len-1))
name[len]= '|';
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index aa407bbf6d4..9a438070e1e 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -810,6 +810,11 @@ static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), rcti *rect)
}
+static int ui_but_draw_menu_icon(uiBut *but)
+{
+ return (but->flag & UI_ICON_SUBMENU) && (but->dt == UI_EMBOSSP);
+}
+
/* icons have been standardized... and this call draws in untransformed coordinates */
static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect)
@@ -888,8 +893,8 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
else
UI_icon_draw_aspect(xs, ys, icon, aspect, alpha);
}
-
- if((but->flag & UI_ICON_SUBMENU) && (but->dt == UI_EMBOSSP)) {
+
+ if (ui_but_draw_menu_icon(but)) {
xs= rect->xmax-17;
ys= (rect->ymin+rect->ymax- height)/2;
@@ -1139,7 +1144,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
/* part text right aligned */
if(cpoin) {
fstyle->align= UI_STYLE_TEXT_RIGHT;
- rect->xmax-=5;
+ rect->xmax -= ui_but_draw_menu_icon(but) ? UI_DPI_ICON_SIZE : 5;
uiStyleFontDraw(fstyle, rect, cpoin+1);
*cpoin= '|';
}
@@ -1612,7 +1617,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state)
if(state & UI_SELECT)
UI_GetThemeColor4ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
else {
- bTheme *btheme= U.themes.first; /* XXX */
+ bTheme *btheme= UI_GetTheme(); /* XXX */
copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text);
}
@@ -2755,7 +2760,7 @@ static void widget_disabled(rcti *rect)
static uiWidgetType *widget_type(uiWidgetTypeEnum type)
{
- bTheme *btheme= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
static uiWidgetType wt;
/* defaults */
@@ -2940,7 +2945,7 @@ 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= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
ThemeUI *tui= &btheme->tui;
uiFontStyle *fstyle= &style->widget;
uiWidgetType *wt= NULL;
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 4581721a776..b47b03d19a3 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -845,6 +845,11 @@ void UI_SetTheme(int spacetype, int regionid)
}
}
+bTheme *UI_GetTheme()
+{
+ return U.themes.first;
+}
+
// for space windows only
void UI_ThemeColor(int colorid)
{
@@ -1674,6 +1679,15 @@ 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;
+ }
+ }
+
/* Freestyle color settings */
{
bTheme *btheme;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 5e97e01aed6..c2c482b0a2c 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1558,7 +1558,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
if (scroll & V2D_SCROLL_HORIZONTAL) {
/* only draw scrollbar when it doesn't fill the entire space */
if(vs->horfull==0) {
- bTheme *btheme= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
uiWidgetColors wcol= btheme->tui.wcol_scroll;
rcti slider;
int state;
@@ -1669,7 +1669,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
if (scroll & V2D_SCROLL_VERTICAL) {
/* only draw scrollbar when it doesn't fill the entire space */
if(vs->vertfull==0) {
- bTheme *btheme= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
uiWidgetColors wcol= btheme->tui.wcol_scroll;
rcti slider;
int state;
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 998e70d5e25..5706da93fe9 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -985,12 +985,12 @@ 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 - ((float)fabs(vzd->lastx - dist) + 2.0f) / ((float)fabs(event->x - dist) + 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);
/* y-axis transform */
dist = (v2d->mask.ymax - v2d->mask.ymin) / 2.0f;
- dy= 1.0f - ((float)fabs(vzd->lasty - dist) + 2.0f) / ((float)fabs(event->y - dist) + 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);
}
else {
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 9b539871cbc..a6d3365ad8a 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -885,10 +885,11 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base)
MEM_freeN(base);
}
-static int object_delete_exec(bContext *C, wmOperator *UNUSED(op))
+static int object_delete_exec(bContext *C, wmOperator *op)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
+ const short use_global= RNA_boolean_get(op->ptr, "global");
/* int islamp= 0; */ /* UNUSED */
if(CTX_data_edit_object(C))
@@ -903,6 +904,22 @@ static int object_delete_exec(bContext *C, wmOperator *UNUSED(op))
/* remove from current scene only */
ED_base_object_free_and_unlink(bmain, scene, base);
+
+ if (use_global) {
+ Scene *scene_iter;
+ Base *base_other;
+
+ for (scene_iter= bmain->scene.first; scene_iter; scene_iter= scene_iter->id.next) {
+ if (scene_iter != scene && !(scene_iter->id.lib)) {
+ base_other= object_in_scene(base->object, scene_iter);
+ if (base_other) {
+ ED_base_object_free_and_unlink(bmain, scene_iter, base_other);
+ }
+ }
+ }
+ }
+ /* end global */
+
}
CTX_DATA_END;
@@ -929,6 +946,8 @@ void OBJECT_OT_delete(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "global", 0, "Delete Globally", "Remove object from all scenes");
}
/**************************** Copy Utilities ******************************/
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 5487cbdadb2..63a316e7f7b 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -153,8 +153,13 @@ typedef struct {
float height_min, height_max;
Image *ima;
DerivedMesh *ssdm;
+ const int *origindex;
} MHeightBakeData;
+typedef struct {
+ const int *origindex;
+} MNormalBakeData;
+
static void multiresbake_get_normal(const MResolvePixelData *data, float norm[], const int face_num, const int vert_index)
{
unsigned int indices[]= {data->mface[face_num].v1, data->mface[face_num].v2,
@@ -501,7 +506,7 @@ static void interp_bilinear_grid(DMGridData *grid, int grid_size, float crn_x, f
interp_bilinear_quad_data(data, u, v, res);
}
-static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int lvl, const int face_index, const float u, const float v, float co[3], float n[3])
+static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *origindex, const int lvl, const int face_index, const float u, const float v, float co[3], float n[3])
{
MFace mface;
DMGridData **grid_data;
@@ -521,9 +526,8 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int lvl,
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 {
- const int *index= lodm->getFaceDataArray(lodm, CD_ORIGINDEX);
int side= (1 << (lvl-1)) + 1;
- int grid_index= index[face_index];
+ int grid_index= origindex[face_index];
int loc_offs= face_index % (1<<(2*lvl));
int cell_index= loc_offs % ((side-1)*(side-1));
int cell_side= grid_size / (side-1);
@@ -587,10 +591,11 @@ static void interp_barycentric_mface(DerivedMesh *dm, MFace *mface, const float
interp_barycentric_tri_data(data, u, v, res);
}
-static void *init_heights_data(MultiresBakeRender *bkr, Image* ima)
+static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
{
MHeightBakeData *height_data;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ DerivedMesh *lodm= bkr->lores_dm;
height_data= MEM_callocN(sizeof(MHeightBakeData), "MultiresBake heightData");
@@ -614,9 +619,23 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image* ima)
height_data->ssdm= subsurf_make_derived_from_derived(bkr->lores_dm, &smd, 0, NULL, 0, 0, 0);
}
+ height_data->origindex= lodm->getFaceDataArray(lodm, CD_ORIGINDEX);
+
return (void*)height_data;
}
+static void *init_normal_data(MultiresBakeRender *bkr, Image *UNUSED(ima))
+{
+ MNormalBakeData *normal_data;
+ DerivedMesh *lodm= bkr->lores_dm;
+
+ normal_data= MEM_callocN(sizeof(MNormalBakeData), "MultiresBake normalData");
+
+ normal_data->origindex= lodm->getFaceDataArray(lodm, CD_ORIGINDEX);
+
+ return (void*)normal_data;
+}
+
static void apply_heights_data(void *bake_data)
{
MHeightBakeData *height_data= (MHeightBakeData*)bake_data;
@@ -698,13 +717,11 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
CLAMP(uv[0], 0.0f, 1.0f);
CLAMP(uv[1], 0.0f, 1.0f);
- get_ccgdm_data(lores_dm, hires_dm, lvl, face_index, uv[0], uv[1], p1, 0);
+ get_ccgdm_data(lores_dm, hires_dm, height_data->origindex, lvl, face_index, uv[0], uv[1], p1, 0);
if(height_data->ssdm) {
- //get_ccgdm_data_ss(lores_dm, height_data->ssdm, lvl, face_index, uv[0], uv[1], p0, n);
- get_ccgdm_data(lores_dm, height_data->ssdm, 0, face_index, uv[0], uv[1], p0, n);
+ get_ccgdm_data(lores_dm, height_data->ssdm, height_data->origindex, 0, face_index, uv[0], uv[1], p0, n);
} else {
- MFace mface;
lores_dm->getFace(lores_dm, face_index, &mface);
if(mface.v4) {
@@ -717,7 +734,6 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
}
sub_v3_v3v3(vec, p1, p0);
- //len= len_v3(vec);
len= dot_v3v3(n, vec);
height_data->heights[pixel]= len;
@@ -740,7 +756,7 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
- 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 *UNUSED(bake_data),
+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)
{
@@ -748,6 +764,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
MFace mface;
Image *ima= mtface[face_index].tpage;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ MNormalBakeData *normal_data= (MNormalBakeData*)bake_data;
float uv[2], *st0, *st1, *st2, *st3;
int pixel= ibuf->x*y + x;
float n[3], vec[3], tmp[3]= {0.5, 0.5, 0.5};
@@ -767,7 +784,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
CLAMP(uv[0], 0.0f, 1.0f);
CLAMP(uv[1], 0.0f, 1.0f);
- get_ccgdm_data(lores_dm, hires_dm, lvl, face_index, uv[0], uv[1], NULL, n);
+ get_ccgdm_data(lores_dm, hires_dm, normal_data->origindex, lvl, face_index, uv[0], uv[1], NULL, n);
mul_v3_m3v3(vec, tangmat, n);
normalize_v3(vec);
@@ -832,7 +849,7 @@ static void bake_images(MultiresBakeRender *bkr)
switch(bkr->mode) {
case RE_BAKE_NORMALS:
- do_multires_bake(bkr, ima, apply_tangmat_callback, NULL, NULL, NULL);
+ do_multires_bake(bkr, ima, apply_tangmat_callback, init_normal_data, NULL, NULL);
break;
case RE_BAKE_DISPLACEMENT:
do_multires_bake(bkr, ima, apply_heights_callback, init_heights_data,
@@ -970,8 +987,7 @@ static DerivedMesh *multiresbake_create_loresdm(Scene *scene, Object *ob, int *l
MultiresModifierData *mmd= get_multires_modifier(scene, ob, 0);
Mesh *me= (Mesh*)ob->data;
- if(ob->mode==OB_MODE_SCULPT) *lvl= mmd->sculptlvl;
- else *lvl= mmd->lvl;
+ *lvl= mmd->lvl;
if(*lvl==0) {
DerivedMesh *tmp_dm= CDDM_from_mesh(me, ob);
@@ -1001,6 +1017,7 @@ static DerivedMesh *multiresbake_create_hiresdm(Scene *scene, Object *ob, int *l
*simple= mmd->simple;
tmp_mmd.lvl= mmd->totlvl;
+ tmp_mmd.sculptlvl= mmd->totlvl;
dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0, 0);
cddm->release(cddm);
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 0fbf5a8bd92..3c84b2df1d2 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -736,7 +736,7 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op)
where_is_pose(scene, ob);
}
else if (ob) {
- Object workob = {{0}};
+ Object workob = {{NULL}};
/* use what_does_parent to find inverse - just like for normal parenting */
what_does_parent(scene, ob, &workob);
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index a6e8d4a0a3a..185d8d43765 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -159,6 +159,7 @@ void OBJECT_OT_multires_external_save(struct wmOperatorType *ot);
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);
/* object_constraint.c */
void OBJECT_OT_constraint_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index ad2280baba2..7b747769e49 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -34,6 +34,7 @@
#include "MEM_guardedalloc.h"
+#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
@@ -48,6 +49,7 @@
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
+#include "BKE_animsys.h"
#include "BKE_curve.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -63,6 +65,7 @@
#include "BKE_multires.h"
#include "BKE_report.h"
#include "BKE_object.h"
+#include "BKE_ocean.h"
#include "BKE_particle.h"
#include "BKE_softbody.h"
@@ -1404,3 +1407,220 @@ void OBJECT_OT_explode_refresh(wmOperatorType *ot)
edit_modifier_properties(ot);
}
+
+/****************** ocean bake operator *********************/
+
+static int ocean_bake_poll(bContext *C)
+{
+ return edit_modifier_poll_generic(C, &RNA_OceanModifier, 0);
+}
+
+/* copied from init_ocean_modifier, MOD_ocean.c */
+static void init_ocean_modifier_bake(struct Ocean *oc, struct OceanModifierData *omd)
+{
+ int do_heightfield, do_chop, do_normals, do_jacobian;
+
+ if (!omd || !oc) return;
+
+ do_heightfield = TRUE;
+ do_chop = (omd->chop_amount > 0);
+ do_normals = (omd->flag & MOD_OCEAN_GENERATE_NORMALS);
+ do_jacobian = (omd->flag & MOD_OCEAN_GENERATE_FOAM);
+
+ BKE_init_ocean(oc, omd->resolution*omd->resolution, omd->resolution*omd->resolution, omd->spatial_size, omd->spatial_size,
+ omd->wind_velocity, omd->smallest_wave, 1.0, omd->wave_direction, omd->damp, omd->wave_alignment,
+ omd->depth, omd->time,
+ do_heightfield, do_chop, do_normals, do_jacobian,
+ omd->seed);
+}
+
+typedef struct OceanBakeJob {
+ /* from wmJob */
+ void *owner;
+ short *stop, *do_update;
+ float *progress;
+ int current_frame;
+ struct OceanCache *och;
+ struct Ocean *ocean;
+ struct OceanModifierData *omd;
+} OceanBakeJob;
+
+static void oceanbake_free(void *customdata)
+{
+ OceanBakeJob *oj= customdata;
+ MEM_freeN(oj);
+}
+
+/* called by oceanbake, only to check job 'stop' value */
+static int oceanbake_breakjob(void *UNUSED(customdata))
+{
+ //OceanBakeJob *ob= (OceanBakeJob *)customdata;
+ //return *(ob->stop);
+
+ /* this is not nice yet, need to make the jobs list template better
+ * for identifying/acting upon various different jobs */
+ /* but for now we'll reuse the render break... */
+ return (G.afbreek);
+}
+
+/* called by oceanbake, wmJob sends notifier */
+static void oceanbake_update(void *customdata, float progress, int *cancel)
+{
+ OceanBakeJob *oj= customdata;
+
+ if (oceanbake_breakjob(oj))
+ *cancel = 1;
+
+ *(oj->do_update)= 1;
+ *(oj->progress)= progress;
+}
+
+static void oceanbake_startjob(void *customdata, short *stop, short *do_update, float *progress)
+{
+ OceanBakeJob *oj= customdata;
+
+ oj->stop= stop;
+ oj->do_update = do_update;
+ oj->progress = progress;
+
+ G.afbreek= 0; /* XXX shared with render - replace with job 'stop' switch */
+
+ BKE_bake_ocean(oj->ocean, oj->och, oceanbake_update, (void *)oj);
+
+ *do_update= 1;
+ *stop = 0;
+}
+
+static void oceanbake_endjob(void *customdata)
+{
+ OceanBakeJob *oj= customdata;
+
+ if (oj->ocean) {
+ BKE_free_ocean(oj->ocean);
+ oj->ocean = NULL;
+ }
+
+ oj->omd->oceancache = oj->och;
+ oj->omd->cached = TRUE;
+}
+
+static int ocean_bake_exec(bContext *C, wmOperator *op)
+{
+ Object *ob = ED_object_active_context(C);
+ OceanModifierData *omd = (OceanModifierData *)edit_modifier_property_get(op, ob, eModifierType_Ocean);
+ Scene *scene = CTX_data_scene(C);
+ OceanCache *och;
+ struct Ocean *ocean;
+ int f, cfra, i=0;
+ int free= RNA_boolean_get(op->ptr, "free");
+
+ wmJob *steve;
+ OceanBakeJob *oj;
+
+ if (!omd)
+ return OPERATOR_CANCELLED;
+
+ if (free) {
+ omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+ return OPERATOR_FINISHED;
+ }
+
+ och = BKE_init_ocean_cache(omd->cachepath, modifier_path_relbase(ob),
+ omd->bakestart, omd->bakeend, omd->wave_scale,
+ omd->chop_amount, omd->foam_coverage, omd->foam_fade, omd->resolution);
+
+ och->time = MEM_mallocN(och->duration*sizeof(float), "foam bake time");
+
+ cfra = scene->r.cfra;
+
+ /* 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,
+ * 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:
+ * --> BKE_animsys_evaluate_animdata(&fsDomain->id, fsDomain->adt, eval_time, ADT_RECALC_ALL);
+ */
+
+ /* Modifying the global scene isn't nice, but we can do it in
+ * this part of the process before a threaded job is created */
+
+ //scene->r.cfra = f;
+ //ED_update_for_newframe(CTX_data_main(C), scene, CTX_wm_screen(C), 1);
+
+ /* ok, this doesn't work with drivers, but is way faster.
+ * let's use this for now and hope nobody wants to drive the time value... */
+ BKE_animsys_evaluate_animdata(scene, (ID *)ob, ob->adt, f, ADT_RECALC_ANIM);
+
+ och->time[i] = omd->time;
+ i++;
+ }
+
+ /* make a copy of ocean to use for baking - threadsafety */
+ ocean = BKE_add_ocean();
+ init_ocean_modifier_bake(ocean, omd);
+
+ /*
+ BKE_bake_ocean(ocean, och);
+
+ omd->oceancache = och;
+ omd->cached = TRUE;
+
+ scene->r.cfra = cfra;
+
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+ */
+
+ /* job stuff */
+
+ scene->r.cfra = cfra;
+
+ /* setup job */
+ steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Ocean Simulation", WM_JOB_PROGRESS);
+ oj= MEM_callocN(sizeof(OceanBakeJob), "ocean bake job");
+ oj->ocean = ocean;
+ oj->och = och;
+ oj->omd = omd;
+
+ WM_jobs_customdata(steve, oj, oceanbake_free);
+ WM_jobs_timer(steve, 0.1, NC_OBJECT|ND_MODIFIER, NC_OBJECT|ND_MODIFIER);
+ WM_jobs_callbacks(steve, oceanbake_startjob, NULL, NULL, oceanbake_endjob);
+
+ WM_jobs_start(CTX_wm_manager(C), steve);
+
+
+
+ return OPERATOR_FINISHED;
+}
+
+static int ocean_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+ if (edit_modifier_invoke_properties(C, op))
+ return ocean_bake_exec(C, op);
+ else
+ return OPERATOR_CANCELLED;
+}
+
+
+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->poll= ocean_bake_poll;
+ ot->invoke= ocean_bake_invoke;
+ ot->exec= ocean_bake_exec;
+
+ /* flags */
+ 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 2df49570ee4..b7fe2d70b37 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -142,6 +142,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_multires_external_pack);
WM_operatortype_append(OBJECT_OT_meshdeform_bind);
WM_operatortype_append(OBJECT_OT_explode_refresh);
+ WM_operatortype_append(OBJECT_OT_ocean_bake);
WM_operatortype_append(OBJECT_OT_constraint_add);
WM_operatortype_append(OBJECT_OT_constraint_add_with_targets);
@@ -337,7 +338,10 @@ void ED_keymap_object(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "OBJECT_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "global", TRUE);
WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "global", TRUE);
+
WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_duplicates_make_real", AKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 0d210fa83eb..936da90e8b7 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -799,7 +799,7 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count)
}
}
if(!length) {
- return 0;
+ return NULL;
}
tverts = MEM_mallocN(sizeof(int)*length, "tempSurroundingVerts");
mf = me->mface;
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 550da63d7aa..6e25307b786 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -53,9 +53,11 @@
#include "WM_types.h"
#include "WM_api.h"
+#include "physics_intern.h" /* own include */
+
static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- DynamicPaintModifierData *pmd = 0;
+ DynamicPaintModifierData *pmd = NULL;
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
@@ -97,7 +99,7 @@ void DPAINT_OT_surface_slot_add(wmOperatorType *ot)
static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- DynamicPaintModifierData *pmd = 0;
+ DynamicPaintModifierData *pmd = NULL;
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
@@ -181,7 +183,7 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot)
/* identifiers */
ot->name= "Toggle Type Active";
ot->idname= "DPAINT_OT_type_toggle";
- ot->description = "Toggles whether given type is active or not";
+ ot->description = "Toggle whether given type is active or not";
/* api callbacks */
ot->exec= type_toggle_exec;
@@ -197,24 +199,23 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot)
static int output_toggle_exec(bContext *C, wmOperator *op)
{
-
Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
Scene *scene = CTX_data_scene(C);
DynamicPaintSurface *surface;
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
- int index= RNA_int_get(op->ptr, "index");
+ int output= RNA_enum_get(op->ptr, "output"); /* currently only 1/0 */
if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED;
surface = get_activeSurface(pmd->canvas);
/* if type is already enabled, toggle it off */
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
- int exists = dynamicPaint_outputLayerExists(surface, ob, index);
- char *name;
+ int exists = dynamicPaint_outputLayerExists(surface, ob, output);
+ const char *name;
- if (index == 0)
+ if (output == 0)
name = surface->output_name;
- else if (index == 1)
+ else
name = surface->output_name2;
/* Vertex Color Layer */
@@ -226,8 +227,9 @@ static int output_toggle_exec(bContext *C, wmOperator *op)
}
/* Vertex Weight Layer */
else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
- if (!exists)
+ if (!exists) {
ED_vgroup_add_name(ob, name);
+ }
else {
bDeformGroup *defgroup = defgroup_find_name(ob, name);
if (defgroup) ED_vgroup_delete(ob, defgroup);
@@ -240,12 +242,16 @@ static int output_toggle_exec(bContext *C, wmOperator *op)
void DPAINT_OT_output_toggle(wmOperatorType *ot)
{
- PropertyRNA *prop;
+ static EnumPropertyItem prop_output_toggle_types[] = {
+ {0, "A", 0, "Output A", ""},
+ {1, "B", 0, "Output B", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
/* identifiers */
ot->name= "Toggle Output Layer";
ot->idname= "DPAINT_OT_output_toggle";
- ot->description = "Adds or removes Dynamic Paint output data layer";
+ ot->description = "Add or remove Dynamic Paint output data layer";
/* api callbacks */
ot->exec= output_toggle_exec;
@@ -255,8 +261,7 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_int(ot->srna, "index", 0, 0, 1, "Index", "", 0, 1);
- ot->prop= prop;
+ ot->prop= RNA_def_enum(ot->srna, "output", prop_output_toggle_types, 0, "Output Toggle", "");
}
@@ -307,22 +312,22 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
*/
{
char filename[FILE_MAX];
- /* make sure output path has ending slash */
- BLI_add_slash(surface->image_output_path);
/* primary output layer */
if (surface->flags & MOD_DPAINT_OUT1) {
/* set filepath */
- BLI_snprintf(filename, sizeof(filename), "%s%s", surface->image_output_path, surface->output_name);
+ BLI_join_dirfile(filename, sizeof(filename), surface->image_output_path, surface->output_name);
BLI_path_frame(filename, frame, 4);
+
/* save image */
dynamicPaint_outputSurfaceImage(surface, filename, 0);
}
/* secondary output */
if (surface->flags & MOD_DPAINT_OUT2 && surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
/* set filepath */
- BLI_snprintf(filename, sizeof(filename), "%s%s", surface->image_output_path, surface->output_name2);
+ BLI_join_dirfile(filename, sizeof(filename), surface->image_output_path, surface->output_name2);
BLI_path_frame(filename, frame, 4);
+
/* save image */
dynamicPaint_outputSurfaceImage(surface, filename, 1);
}
@@ -333,9 +338,9 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
/*
-* Bake Dynamic Paint image sequence surface
-*/
-int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
+ * Bake Dynamic Paint image sequence surface
+ */
+static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
{
DynamicPaintModifierData *pmd = NULL;
DynamicPaintCanvasSettings *canvas;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 6e88d477d9c..9dd4503414a 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -640,14 +640,17 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings
const char *suffixConfig = FLUID_SUFFIX_CONFIG;
int outStringsChanged = 0;
-
+
// prepare names...
- strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
- strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.main->name); // fixed #frame-no
+ const char *relbase= modifier_path_relbase(fsDomain);
+
+ BLI_strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
+ 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
- // .tmp: dont overwrite/delete original file
- BLI_snprintf(targetFile, FILE_MAXDIR+FILE_MAXFILE, "%s%s.tmp", targetDir, suffixConfig);
+ BLI_join_dirfile(targetFile, FILE_MAX, targetDir, suffixConfig);
+ /* .tmp: dont overwrite/delete original file */
+ strncat(targetFile, ".tmp", FILE_MAX);
// make sure all directories exist
// as the bobjs use the same dir, this only needs to be checked
@@ -663,7 +666,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
BLI_delete(targetFile, 0,0);
}
- if((strlen(targetDir)<1) || (!dirExist)) {
+ if(targetDir[0] == '\0' || (!dirExist)) {
char blendDir[FILE_MAXDIR+FILE_MAXFILE];
char blendFile[FILE_MAXDIR+FILE_MAXFILE];
@@ -805,20 +808,20 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects,
}
/* copied from rna_fluidsim.c: fluidsim_find_lastframe() */
-static void fluidsim_delete_until_lastframe(FluidsimSettings *fss)
+static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *relbase)
{
char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
char targetDirVel[FILE_MAXFILE+FILE_MAXDIR], targetFileVel[FILE_MAXFILE+FILE_MAXDIR];
char previewDir[FILE_MAXFILE+FILE_MAXDIR], previewFile[FILE_MAXFILE+FILE_MAXDIR];
int curFrame = 1, exists = 0;
- BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath);
- BLI_snprintf(targetDirVel, sizeof(targetDir), "%sfluidsurface_final_####.bvel.gz", fss->surfdataPath);
- BLI_snprintf(previewDir, sizeof(targetDir), "%sfluidsurface_preview_####.bobj.gz", fss->surfdataPath);
+ BLI_join_dirfile(targetDir, sizeof(targetDir), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME);
+ BLI_join_dirfile(targetDirVel, sizeof(targetDirVel), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_VEL_FNAME);
+ BLI_join_dirfile(previewDir, sizeof(previewDir), fss->surfdataPath, OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME);
- BLI_path_abs(targetDir, G.main->name);
- BLI_path_abs(targetDirVel, G.main->name);
- BLI_path_abs(previewDir, G.main->name);
+ BLI_path_abs(targetDir, relbase);
+ BLI_path_abs(targetDirVel, relbase);
+ BLI_path_abs(previewDir, relbase);
do {
BLI_strncpy(targetFile, targetDir, sizeof(targetFile));
@@ -851,6 +854,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
char debugStrBuffer[256];
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 *suffixSurface = FLUID_SUFFIX_SURFACE;
@@ -911,7 +915,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
domainSettings->lastgoodframe = -1;
/* delete old baked files */
- fluidsim_delete_until_lastframe(domainSettings);
+ fluidsim_delete_until_lastframe(domainSettings, relbase);
/* rough check of settings... */
if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
@@ -997,7 +1001,8 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* ******** start writing / exporting ******** */
// use .tmp, dont overwrite/delete original file
- BLI_snprintf(targetFile, 240, "%s%s.tmp", targetDir, suffixConfig);
+ BLI_join_dirfile(targetFile, sizeof(targetFile), targetDir, suffixConfig);
+ strncat(targetFile, ".tmp", sizeof(targetFile));
// make sure these directories exist as well
if(outStringsChanged) {
@@ -1025,7 +1030,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
fsset->aniFrameTime = channels->aniFrameTime;
fsset->noOfFrames = noFrames; // is otherwise subtracted in parser
- BLI_snprintf(targetFile, 240, "%s%s", targetDir, suffixSurface);
+ BLI_join_dirfile(targetFile, sizeof(targetFile), targetDir, suffixSurface);
// defaults for compressibility and adaptive grids
fsset->gstar = domainSettings->gstar;
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index cc1c8843015..6931b0b86db 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -322,10 +322,13 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
spos+= sprintf(spos, "%s ", rs->statstr);
}
else {
- spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (scene->r.cfra), rs->totvert, rs->totface);
+ 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);
- spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory, megs_peak_memory);
+ 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);
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index fa764e6eefc..188a61181ce 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -73,6 +73,7 @@
#include "render_intern.h"
typedef struct OGLRender {
+ Main *bmain;
Render *re;
Scene *scene;
@@ -147,7 +148,7 @@ 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, NULL);
+ 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);
}
@@ -223,7 +224,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
IMB_color_to_bw(ibuf);
}
- BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE);
+ BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE);
ok= BKE_write_ibuf(ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality); /* 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);
@@ -292,6 +293,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->ofs= ofs;
oglrender->sizex= sizex;
oglrender->sizey= sizey;
+ oglrender->bmain= CTX_data_main(C);
oglrender->scene= scene;
oglrender->write_still= is_write_still && !is_animation;
@@ -462,7 +464,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
}
}
else {
- BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
ok= BKE_write_ibuf_stamp(scene, camera, ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality);
if(ok==0) {
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 32ad198c1d7..1343eb2947d 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -523,7 +523,7 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
- scene_add_render_layer(scene);
+ scene_add_render_layer(scene, NULL);
scene->r.actlay= BLI_countlist(&scene->r.layers) - 1;
WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
@@ -547,32 +547,11 @@ void SCENE_OT_render_layer_add(wmOperatorType *ot)
static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene = CTX_data_scene(C), *sce;
- SceneRenderLayer *rl;
- int act= scene->r.actlay;
+ Scene *scene = CTX_data_scene(C);
+ SceneRenderLayer *rl = BLI_findlink(&scene->r.layers, scene->r.actlay);
- if(BLI_countlist(&scene->r.layers) <= 1)
+ if(!scene_remove_render_layer(CTX_data_main(C), scene, rl))
return OPERATOR_CANCELLED;
-
- rl= BLI_findlink(&scene->r.layers, scene->r.actlay);
- BLI_remlink(&scene->r.layers, rl);
- MEM_freeN(rl);
-
- scene->r.actlay= 0;
-
- for(sce = CTX_data_main(C)->scene.first; 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_R_LAYERS && (Scene*)node->id==scene) {
- if(node->custom1==act)
- node->custom1= 0;
- else if(node->custom1>act)
- node->custom1--;
- }
- }
- }
- }
WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e6ae8698b14..f3d087d6986 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -169,8 +169,14 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar)
static void area_draw_azone(short x1, short y1, short x2, short y2)
{
- int dx= floor(0.3f*(x2-x1));
- int dy= floor(0.3f*(y2-y1));
+ int dx = x2 - x1;
+ int dy = y2 - y1;
+
+ dx= copysign(ceil(0.3f*fabs(dx)), dx);
+ dy= copysign(ceil(0.3f*fabs(dy)), dy);
+
+ glEnable(GL_BLEND);
+ glEnable(GL_LINE_SMOOTH);
glColor4ub(255, 255, 255, 180);
fdrawline(x1, y2, x2, y1);
@@ -185,8 +191,10 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
fdrawline(x1, y2-dy+1, x2-dx+1, y1);
glColor4ub(0, 0, 0, 150);
fdrawline(x1, y2-2*dy+1, x2-2*dx+1, y1);
-}
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_BLEND);
+}
static void region_draw_azone_icon(AZone *az)
{
@@ -222,6 +230,49 @@ static void region_draw_azone_icon(AZone *az)
sdrawline(midx-2, midy, midx+3, midy);
}
+static void draw_azone_plus(float x1, float y1, float x2, float y2)
+{
+ float width = 2.0f;
+ float pad = 4.0f;
+
+ glRectf((x1 + x2 - width)*0.5f, y1 + pad, (x1 + x2 + width)*0.5f, y2 - pad);
+ glRectf(x1 + pad, (y1 + y2 - width)*0.5f, (x1 + x2 - width)*0.5f, (y1 + y2 + width)*0.5f);
+ glRectf((x1 + x2 + width)*0.5f, (y1 + y2 - width)*0.5f, x2 - pad, (y1 + y2 + width)*0.5f);
+}
+
+static void region_draw_azone_tab_plus(AZone *az)
+{
+ extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */
+
+ glEnable(GL_BLEND);
+
+ /* add code to draw region hidden as 'too small' */
+ switch(az->edge) {
+ case AE_TOP_TO_BOTTOMRIGHT:
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
+ break;
+ case AE_BOTTOM_TO_TOPLEFT:
+ uiSetRoundBox(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
+ break;
+ case AE_LEFT_TO_TOPRIGHT:
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
+ break;
+ case AE_RIGHT_TO_TOPLEFT:
+ uiSetRoundBox(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT);
+ break;
+ }
+
+ glColor4f(0.05f, 0.05f, 0.05f, 0.5f);
+ uiRoundBox((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
+
+ glEnable(GL_BLEND);
+
+ glColor4f(0.8f, 0.8f, 0.8f, 0.5f);
+ draw_azone_plus((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2);
+
+ glDisable(GL_BLEND);
+}
+
static void region_draw_azone_tab(AZone *az)
{
float col[3];
@@ -320,13 +371,14 @@ void ED_area_overdraw(bContext *C)
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==2)
+ if(G.rt==3)
+ region_draw_azone_icon(az);
+ else if(G.rt==2)
region_draw_azone_tria(az);
else if(G.rt==1)
region_draw_azone_tab(az);
else
- region_draw_azone_icon(az);
+ region_draw_azone_tab_plus(az);
}
}
}
@@ -550,19 +602,19 @@ static void area_azone_initialize(ScrArea *sa)
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_AREA;
- az->x1= sa->totrct.xmin;
- az->y1= sa->totrct.ymin;
- az->x2= sa->totrct.xmin + AZONESPOT;
- az->y2= sa->totrct.ymin + AZONESPOT;
+ az->x1= sa->totrct.xmin - 1;
+ az->y1= sa->totrct.ymin - 1;
+ az->x2= sa->totrct.xmin + (AZONESPOT-1);
+ az->y2= sa->totrct.ymin + (AZONESPOT-1);
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_AREA;
- az->x1= sa->totrct.xmax+1;
- az->y1= sa->totrct.ymax+1;
- az->x2= sa->totrct.xmax-AZONESPOT;
- az->y2= sa->totrct.ymax-AZONESPOT;
+ az->x1= sa->totrct.xmax + 1;
+ az->y1= sa->totrct.ymax + 1;
+ az->x2= sa->totrct.xmax - (AZONESPOT-1);
+ az->y2= sa->totrct.ymax - (AZONESPOT-1);
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
@@ -659,6 +711,51 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
}
}
+#define AZONEPAD_TAB_PLUSW 16
+#define AZONEPAD_TAB_PLUSH 16
+
+/* region already made zero sized, in shape of edge */
+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++;
+ }
+
+ switch(az->edge) {
+ case AE_TOP_TO_BOTTOMRIGHT:
+ 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;
+ az->y2= ar->winrct.ymax - add + AZONEPAD_TAB_PLUSH;
+ break;
+ case AE_BOTTOM_TO_TOPLEFT:
+ az->x1= ar->winrct.xmax - 2.5*AZONEPAD_TAB_PLUSW;
+ az->y1= ar->winrct.ymin - AZONEPAD_TAB_PLUSH;
+ az->x2= ar->winrct.xmax - 1.5*AZONEPAD_TAB_PLUSW;
+ az->y2= ar->winrct.ymin;
+ break;
+ case AE_LEFT_TO_TOPRIGHT:
+ az->x1= ar->winrct.xmin + 1 - AZONEPAD_TAB_PLUSH;
+ az->y1= ar->winrct.ymax - 2.5*AZONEPAD_TAB_PLUSW;
+ az->x2= ar->winrct.xmin + 1;
+ az->y2= ar->winrct.ymax - 1.5*AZONEPAD_TAB_PLUSW;
+ break;
+ case AE_RIGHT_TO_TOPLEFT:
+ az->x1= ar->winrct.xmax - 1;
+ az->y1= ar->winrct.ymax - 2.5*AZONEPAD_TAB_PLUSW;
+ az->x2= ar->winrct.xmax - 1 + AZONEPAD_TAB_PLUSH;
+ az->y2= ar->winrct.ymax - 1.5*AZONEPAD_TAB_PLUSW;
+ break;
+ }
+ /* rect needed for mouse pointer test */
+ BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
+}
+
+
#define AZONEPAD_TABW 18
#define AZONEPAD_TABH 7
@@ -760,12 +857,14 @@ 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==2)
+ if(G.rt==3)
+ region_azone_icon(sa, az, ar);
+ else if(G.rt==2)
region_azone_tria(sa, az, ar);
else if(G.rt==1)
region_azone_tab(sa, az, ar);
else
- region_azone_icon(sa, az, ar);
+ region_azone_tab_plus(sa, az, ar);
} else {
region_azone_edge(az, ar);
}
@@ -1460,7 +1559,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
Panel *panel;
View2D *v2d= &ar->v2d;
View2DScrollers *scrollers;
- int xco, yco, x, y, miny=0, w, em, header, triangle, open, newcontext= 0;
+ int x, y, xco, yco, w, em, triangle, open, newcontext= 0;
if(contextnr >= 0)
newcontext= UI_view2d_tab_set(v2d, contextnr);
@@ -1474,9 +1573,6 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
}
- x= 0;
- y= -style->panelouter;
-
/* create panels */
uiBeginPanels(C, ar);
@@ -1495,16 +1591,12 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
panel= uiBeginPanel(sa, ar, block, pt, &open);
/* bad fixed values */
- header= (pt->flag & PNL_NO_HEADER)? 0: UI_UNIT_Y;
triangle= (int)(UI_UNIT_Y * 1.1f);
- if(vertical)
- y -= header;
-
- if(pt->draw_header && 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, header+style->panelspace, header, 1, style);
+ triangle, UI_UNIT_Y+style->panelspace, UI_UNIT_Y, 1, style);
pt->draw_header(C, panel);
@@ -1542,30 +1634,11 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
}
uiEndBlock(C, block);
-
- if(vertical) {
- if(pt->flag & PNL_NO_HEADER)
- y += yco;
- else
- y += yco-style->panelouter;
- }
- else {
- x += w;
- miny= MIN2(y, yco-style->panelouter-header);
- }
}
}
- if(vertical)
- x += w;
- else
- y= miny;
-
- /* in case there are no panels */
- if(x == 0 || y == 0) {
- x= UI_PANEL_WIDTH;
- y= UI_PANEL_WIDTH;
- }
+ /* align panels and return size */
+ uiEndPanels(C, ar, &x, &y);
/* clear */
UI_ThemeClearColor((ar->type->regionid == RGN_TYPE_PREVIEW)?TH_PREVIEW_BACK:TH_BACK);
@@ -1607,9 +1680,9 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
/* set the view */
UI_view2d_view_ortho(v2d);
- /* this does the actual drawing! */
- uiEndPanels(C, ar);
-
+ /* draw panels */
+ uiDrawPanels(C, ar);
+
/* restore view matrix */
UI_view2d_view_restore(C);
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 017325c535e..8a90aadbee2 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -219,6 +219,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
/* *************** screenshot movie job ************************* */
typedef struct ScreenshotJob {
+ Main *bmain;
Scene *scene;
unsigned int *dumprect;
int x, y, dumpsx, dumpsy;
@@ -297,7 +298,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
char name[FILE_MAXDIR+FILE_MAXFILE];
int ok;
- BKE_makepicstring(name, rd.pic, cfra, rd.imtype, rd.scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, rd.pic, sj->bmain->name, cfra, rd.imtype, rd.scemode & R_EXTENSION, TRUE);
ibuf->rect= sj->dumprect;
ok= BKE_write_ibuf(ibuf, name, rd.imtype, rd.subimtype, rd.quality);
@@ -355,6 +356,7 @@ static int screencast_exec(bContext *C, wmOperator *op)
sj->dumpsx= curarea->totrct.xmax - sj->x;
sj->dumpsy= curarea->totrct.ymax - sj->y;
}
+ sj->bmain= CTX_data_main(C);
sj->scene= CTX_data_scene(C);
BKE_reports_init(&sj->reports, RPT_PRINT);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index e283927b76f..9b256acbca9 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -3057,25 +3057,24 @@ static void project_paint_begin(ProjPaintState *ps)
invert_m4_m4(viewinv, viewmat);
}
else if (ps->source==PROJ_SRC_IMAGE_CAM) {
- Object *camera= ps->scene->camera;
-
- /* dont actually use these */
- float _viewdx, _viewdy, _ycor, _lens=0.0f, _sensor_x=DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
- short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
- rctf _viewplane;
+ Object *cam_ob= ps->scene->camera;
+ CameraParams params;
/* viewmat & viewinv */
- copy_m4_m4(viewinv, ps->scene->camera->obmat);
+ copy_m4_m4(viewinv, cam_ob->obmat);
normalize_m4(viewinv);
invert_m4_m4(viewmat, viewinv);
- /* camera winmat */
- object_camera_mode(&ps->scene->r, camera);
- object_camera_matrix(&ps->scene->r, camera, ps->winx, ps->winy, 0,
- winmat, &_viewplane, &ps->clipsta, &ps->clipend,
- &_lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_ycor, &_viewdx, &_viewdy);
+ /* window matrix, clipping and ortho */
+ camera_params_init(&params);
+ camera_params_from_object(&params, cam_ob);
+ camera_params_compute_viewplane(&params, ps->winx, ps->winy, 1.0f, 1.0f);
+ camera_params_compute_matrix(&params);
- ps->is_ortho= (ps->scene->r.mode & R_ORTHO) ? 1 : 0;
+ copy_m4_m4(winmat, params.winmat);
+ ps->clipsta= params.clipsta;
+ ps->clipend= params.clipend;
+ ps->is_ortho= params.is_ortho;
}
/* same as view3d_get_object_project_mat */
@@ -5669,7 +5668,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
val.array.len = PROJ_VIEW_DATA_SIZE;
val.array.type = IDP_FLOAT;
- view_data = IDP_New(IDP_ARRAY, val, PROJ_VIEW_DATA_ID);
+ 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);
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index f717b827a7e..1382d58482d 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -269,11 +269,16 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
short mode=0, selectmode=0;
- int gesture_mode;
+ int gesture_mode, extend;
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+
+ /* clear all selection if not extending selection */
+ extend= RNA_boolean_get(op->ptr, "extend");
+ if (!extend)
+ deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
/* get settings from operator */
rect.xmin= RNA_int_get(op->ptr, "xmin");
@@ -330,7 +335,7 @@ void ACTION_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
}
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 9de804d275f..4c028612320 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -805,7 +805,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
if(ma) {
bNode *node= give_current_material_texture_node(ma);
- CTX_data_pointer_set(result, &ma->id, &RNA_Node, node);
+ CTX_data_pointer_set(result, &ma->nodetree->id, &RNA_Node, node);
}
}
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index 149aa9106b0..43eb45b17a7 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -320,6 +320,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
MarkerUpdateCb *cb;
+ const char *tip;
if(!ptr->data)
return;
@@ -353,7 +354,12 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
if(compact) {
block= uiLayoutGetBlock(layout);
- bt= uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, "Marker is disabled for current frame.");
+ 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);
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
} else {
int width, height, step, digits;
@@ -394,8 +400,13 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
uiBlockSetHandleFunc(block, marker_block_handler, cb);
uiBlockSetNFunc(block, marker_update_cb, cb, NULL);
+ if(cb->marker_flag&MARKER_DISABLED)
+ tip= "Marker is disabled at current frame";
+ else
+ tip= "Marker is enabled at current frame";
+
uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, "Enabled", 10, 190, 145, 19, &cb->marker_flag,
- 0, 0, 0, 0, "Marker is disabled for current frame.");
+ 0, 0, 0, 0, tip);
col= uiLayoutColumn(layout, 1);
uiLayoutSetActive(col, (cb->marker_flag&MARKER_DISABLED)==0);
@@ -405,21 +416,21 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0],
- -10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates.");
+ -10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates");
uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1],
- -10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates.");
+ -10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates");
uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0],
- -10*width, 10.0*width, step, digits, "X-offset to parenting point.");
+ -10*width, 10.0*width, step, digits, "X-offset to parenting point");
uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1],
- -10*height, 10.0*height, step, digits, "Y-offset to parenting point.");
+ -10*height, 10.0*height, step, digits, "Y-offset to parenting point");
uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->track_pat[0], 3.0f,
- 10.0*width, step, digits, "Width of marker's pattern in screen soordinates.");
+ 10.0*width, step, digits, "Width of marker's pattern in screen coordinates");
uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->track_pat[1], 3.0f,
- 10.0*height, step, digits, "Height of marker's pattern in screen soordinates.");
+ 10.0*height, step, digits, "Height of marker's pattern in screen coordinates");
uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->track_search_pos[0],
@@ -427,9 +438,9 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->track_search_pos[1],
-height, height, step, digits, "X-position of search at frame relative to marker's position");
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->track_search[0], 3.0f,
- 10.0*width, step, digits, "Width of marker's search in screen soordinates.");
+ 10.0*width, step, digits, "Width of marker's search in screen soordinates");
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->track_search[1], 3.0f,
- 10.0*height, step, digits, "Height of marker's search in screen soordinates.");
+ 10.0*height, step, digits, "Height of marker's search in screen soordinates");
uiBlockEndAlign(block);
}
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index d713303ca8b..c4a858797e5 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -929,7 +929,7 @@ 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 indeces using the job system";
+ ot->description= "Rebuild all selected proxies and timecode indeces in the background";
/* api callbacks */
ot->exec= sequencer_rebuild_proxy_exec;
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c
index c8113c5ea7b..fe09c5cd829 100644
--- a/source/blender/editors/space_clip/clip_toolbar.c
+++ b/source/blender/editors/space_clip/clip_toolbar.c
@@ -50,6 +50,8 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "clip_intern.h" /* own include */
+
/* ************************ header area region *********************** */
/************************** properties ******************************/
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index e9006f5b1e9..43df8b0ea47 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -869,7 +869,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
MovieTrackingTrack *track;
rcti rect;
rctf rectf;
- int change= 0, mode;
+ int change= 0, mode, extend;
/* get rectangle from operator */
rect.xmin= RNA_int_get(op->ptr, "xmin");
@@ -881,6 +881,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
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");
/* do actual selection */
track= clip->tracking.tracks.first;
@@ -888,8 +889,13 @@ static int border_select_exec(bContext *C, wmOperator *op)
if((track->flag&TRACK_HIDDEN)==0) {
MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
- if(MARKER_VISIBLE(sc, marker) && BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
- BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
+ 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) {
+ BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 1);
+ }
change= 1;
}
@@ -921,10 +927,10 @@ void CLIP_OT_select_border(wmOperatorType *ot)
ot->poll= ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag= OPTYPE_UNDO;
/* properties */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
/********************** circle select operator *********************/
@@ -1504,24 +1510,6 @@ void CLIP_OT_track_markers(wmOperatorType *ot)
/********************** solve camera operator *********************/
-static int check_solve_track_count(MovieTracking *tracking)
-{
- int tot= 0;
- int frame1= tracking->settings.keyframe1, frame2= tracking->settings.keyframe2;
- MovieTrackingTrack *track;
-
- track= tracking->tracks.first;
- while(track) {
- if(BKE_tracking_has_marker(track, frame1))
- if(BKE_tracking_has_marker(track, frame2))
- tot++;
-
- track= track->next;
- }
-
- return tot>=8;
-}
-
static int solve_camera_exec(bContext *C, wmOperator *op)
{
SpaceClip *sc= CTX_wm_space_clip(C);
@@ -1530,9 +1518,11 @@ static int solve_camera_exec(bContext *C, wmOperator *op)
MovieTracking *tracking= &clip->tracking;
int width, height;
float error;
+ char error_msg[255];
+
+ if(!BKE_tracking_can_solve(tracking, error_msg, sizeof(error_msg))) {
+ BKE_report(op->reports, RPT_ERROR, error_msg);
- if(!check_solve_track_count(tracking)) {
- BKE_report(op->reports, RPT_ERROR, "At least 8 tracks on both of keyframes are needed for reconstruction");
return OPERATOR_CANCELLED;
}
@@ -1669,7 +1659,7 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot)
/* identifiers */
ot->name= "Clear Track Path";
- ot->description= "Clear path of selected tracks";
+ ot->description= "Clear tracks after/before current position or clear the whole track";
ot->idname= "CLIP_OT_clear_track_path";
/* api callbacks */
@@ -1929,11 +1919,10 @@ static int set_floor_exec(bContext *C, wmOperator *op)
object_apply_mat4(parent, newmat, 0, 0);
/* make camera have positive z-coordinate */
- mul_v3_m4v3(vec[0], mat, camera->loc);
- if(camera->loc[2]<0) {
+ if(parent->loc[2]<0) {
invert_m4(rot);
mul_m4_m4m4(newmat, mat, rot);
- object_apply_mat4(camera, newmat, 0, 0);
+ object_apply_mat4(parent, newmat, 0, 0);
}
where_is_object(scene, parent);
@@ -2135,7 +2124,7 @@ void CLIP_OT_set_center_principal(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Principal to Center";
- ot->description= "Set principal point to center of footage";
+ ot->description= "Set optical center to center of footage";
ot->idname= "CLIP_OT_set_center_principal";
/* api callbacks */
@@ -2301,7 +2290,7 @@ void CLIP_OT_detect_features(wmOperatorType *ot)
/* identifiers */
ot->name= "Detect Features";
- ot->description= "Automatically detect features to track";
+ ot->description= "Automatically detect features and place markers to track";
ot->idname= "CLIP_OT_detect_features";
/* api callbacks */
@@ -2926,7 +2915,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
/* identifiers */
ot->name= "Clean Tracks";
- ot->description= "Clean tracks";
+ ot->description= "Clean tracks with high error values or few frames";
ot->idname= "CLIP_OT_clean_tracks";
/* api callbacks */
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index d6bab41f719..69c192b077b 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -273,13 +273,20 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
ARegion *ar= CTX_wm_region(C);
rcti rect;
FileSelect ret;
-
+ 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");
+ if(!extend) {
+ SpaceFile *sfile= CTX_wm_space_file(C);
+
+ file_deselect_all(sfile, SELECTED_FILE);
+ }
+
BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect);
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, 0);
@@ -306,7 +313,7 @@ void FILE_OT_select_border(wmOperatorType *ot)
ot->cancel= WM_border_select_cancel;
/* rna */
- WM_operator_properties_gesture_border(ot, 0);
+ WM_operator_properties_gesture_border(ot, 1);
}
static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 6506933df54..2ba79ee230a 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -81,8 +81,9 @@
* 0 = deselect
* 1 = select
* 2 = invert
+ * - do_channels: whether to affect selection status of channels
*/
-static void deselect_graph_keys (bAnimContext *ac, short test, short sel)
+static void deselect_graph_keys (bAnimContext *ac, short test, short sel, short do_channels)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
@@ -121,19 +122,22 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel)
/* Keyframes First */
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL);
- /* only change selection of channel when the visibility of keyframes doesn't depend on this */
- if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) {
- /* deactivate the F-Curve, and deselect if deselecting keyframes.
- * otherwise select the F-Curve too since we've selected all the keyframes
- */
- if (sel == SELECT_SUBTRACT)
- fcu->flag &= ~FCURVE_SELECTED;
- else
- fcu->flag |= FCURVE_SELECTED;
+ /* affect channel selection status? */
+ if (do_channels) {
+ /* only change selection of channel when the visibility of keyframes doesn't depend on this */
+ if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) {
+ /* deactivate the F-Curve, and deselect if deselecting keyframes.
+ * otherwise select the F-Curve too since we've selected all the keyframes
+ */
+ if (sel == SELECT_SUBTRACT)
+ fcu->flag &= ~FCURVE_SELECTED;
+ else
+ fcu->flag |= FCURVE_SELECTED;
+ }
+
+ /* always deactivate all F-Curves if we perform batch ops for selection */
+ fcu->flag &= ~FCURVE_ACTIVE;
}
-
- /* always deactivate all F-Curves if we perform batch ops for selection */
- fcu->flag &= ~FCURVE_ACTIVE;
}
/* Cleanup */
@@ -152,9 +156,9 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
/* 'standard' behaviour - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
- deselect_graph_keys(&ac, 0, SELECT_INVERT);
+ deselect_graph_keys(&ac, 0, SELECT_INVERT, TRUE);
else
- deselect_graph_keys(&ac, 1, SELECT_ADD);
+ deselect_graph_keys(&ac, 1, SELECT_ADD, TRUE);
/* set notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
@@ -285,11 +289,17 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
rcti rect;
short mode=0, selectmode=0;
short incl_handles;
+ int extend;
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
-
+
+ /* clear all selection if not extending selection */
+ extend= RNA_boolean_get(op->ptr, "extend");
+ if (!extend)
+ deselect_graph_keys(&ac, 1, SELECT_SUBTRACT, TRUE);
+
/* get select mode
* - 'gesture_mode' from the operator specifies how to select
* - 'include_handles' from the operator specifies whether to include handles in the selection
@@ -350,7 +360,7 @@ void GRAPH_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
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");
@@ -735,7 +745,7 @@ static void graphkeys_select_leftright (bAnimContext *ac, short leftright, short
/* - deselect all other keyframes, so that just the newly selected remain
* - channels aren't deselected, since we don't re-select any as a consequence
*/
- deselect_graph_keys(ac, 0, SELECT_SUBTRACT);
+ deselect_graph_keys(ac, 0, SELECT_SUBTRACT, FALSE);
}
/* set callbacks and editing data */
@@ -1106,8 +1116,8 @@ static void mouse_graph_keys (bAnimContext *ac, const int mval[2], short select_
/* reset selection mode */
select_mode= SELECT_ADD;
- /* deselect all other keyframes */
- deselect_graph_keys(ac, 0, SELECT_SUBTRACT);
+ /* deselect all other keyframes (+ F-Curves too) */
+ deselect_graph_keys(ac, 0, SELECT_SUBTRACT, TRUE);
/* deselect other channels too, but only only do this if
* selection of channel when the visibility of keyframes
@@ -1217,7 +1227,6 @@ static void graphkeys_mselect_column (bAnimContext *ac, const int mval[2], short
bAnimListElem *ale;
int filter;
- SpaceIpo *sipo= (SpaceIpo *)ac->sl;
KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked;
tNearestVertInfo *nvi;
@@ -1237,20 +1246,15 @@ static void graphkeys_mselect_column (bAnimContext *ac, const int mval[2], short
else if (nvi->fpt)
selx= nvi->fpt->vec[0];
- /* if select mode is replace, deselect all keyframes (and channels) first */
+ /* if select mode is replace, deselect all keyframes first */
if (select_mode==SELECT_REPLACE) {
/* reset selection mode to add to selection */
select_mode= SELECT_ADD;
- /* deselect all other keyframes */
- deselect_graph_keys(ac, 0, SELECT_SUBTRACT);
-
- /* deselect other channels too, but only only do this if
- * selection of channel when the visibility of keyframes
- * doesn't depend on this
+ /* - deselect all other keyframes, so that just the newly selected remain
+ * - channels aren't deselected, since we don't re-select any as a consequence
*/
- if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0)
- ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
+ deselect_graph_keys(ac, 0, SELECT_SUBTRACT, FALSE);
}
/* initialise keyframe editing data */
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index eab6cb5402f..206639f064a 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -220,6 +220,7 @@ static int borderselect_exec(bContext *C, wmOperator *op)
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);
@@ -244,6 +245,16 @@ static int borderselect_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
*/
+ if(!extend) {
+ for(report= reports->list.first; report; report= report->next) {
+
+ 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);
@@ -308,7 +319,7 @@ void INFO_OT_select_border(wmOperatorType *ot)
/* ot->flag= OPTYPE_REGISTER; */
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 25e1d2f2816..52e6a8808ae 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -40,6 +40,7 @@
#include "BLI_utildefines.h"
#include "BKE_anim.h"
+#include "BKE_blender.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_DerivedMesh.h"
@@ -362,7 +363,6 @@ static void stats_update(Scene *scene)
static void stats_string(Scene *scene)
{
- extern char versionstr[]; /* from blender.c */
SceneStats *stats= scene->stats;
Object *ob= (scene->basact)? scene->basact->object: NULL;
uintptr_t mem_in_use, mmap_in_use;
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 49340b31b47..0cb48582bc9 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -282,11 +282,17 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
short mode=0, selectmode=0;
+ int extend;
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
-
+
+ /* clear all selection if not extending selection */
+ extend= RNA_boolean_get(op->ptr, "extend");
+ if (!extend)
+ 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");
@@ -341,7 +347,7 @@ void NLA_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, 0);
+ WM_operator_properties_gesture_border(ot, 1);
RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index e2e47338eee..92592a7c071 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -947,28 +947,27 @@ static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA
static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
- PointerRNA mappingptr = RNA_pointer_get(ptr, "mapping");
uiLayout *row;
uiItemL(layout, "Location:", ICON_NONE);
row= uiLayoutRow(layout, 1);
- uiItemR(row, &mappingptr, "location", 0, "", ICON_NONE);
+ uiItemR(row, ptr, "location", 0, "", ICON_NONE);
uiItemL(layout, "Rotation:", ICON_NONE);
row= uiLayoutRow(layout, 1);
- uiItemR(row, &mappingptr, "rotation", 0, "", ICON_NONE);
+ uiItemR(row, ptr, "rotation", 0, "", ICON_NONE);
uiItemL(layout, "Scale:", ICON_NONE);
row= uiLayoutRow(layout, 1);
- uiItemR(row, &mappingptr, "scale", 0, "", ICON_NONE);
+ uiItemR(row, ptr, "scale", 0, "", ICON_NONE);
row= uiLayoutRow(layout, 1);
- uiItemR(row, &mappingptr, "use_min", 0, "Min", ICON_NONE);
- uiItemR(row, &mappingptr, "min", 0, "", ICON_NONE);
+ uiItemR(row, ptr, "use_min", 0, "Min", ICON_NONE);
+ uiItemR(row, ptr, "min", 0, "", ICON_NONE);
row= uiLayoutRow(layout, 1);
- uiItemR(row, &mappingptr, "use_max", 0, "Max", ICON_NONE);
- uiItemR(row, &mappingptr, "max", 0, "", ICON_NONE);
+ uiItemR(row, ptr, "use_max", 0, "Max", ICON_NONE);
+ uiItemR(row, ptr, "max", 0, "", ICON_NONE);
}
static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 36cba15e5f2..c4a7f2cb473 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -73,6 +73,8 @@
#include "NOD_composite.h"
#include "NOD_shader.h"
+#include "intern/node_util.h"
+
#include "node_intern.h"
/* width of socket columns in group display */
@@ -418,38 +420,41 @@ static int node_get_colorid(bNode *node)
return TH_NODE;
}
-/* note: in cmp_util.c is similar code, for node_compo_pass_on() */
+/* note: in cmp_util.c is similar code, for node_compo_pass_on()
+ * the same goes for shader and texture nodes. */
/* note: in node_edit.c is similar code, for untangle node */
static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
{
- static int types[]= { SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA };
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
bNodeLink link= {NULL};
int i;
-
- /* connect the first input of each type with first output of the same type */
-
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return;
+
+ /* Get default muting links (as bNodeSocket pointers). */
+ links = node->typeinfo->mutelinksfunc(snode->edittree, node, NULL, NULL, NULL, NULL);
+
glEnable(GL_BLEND);
- glEnable( GL_LINE_SMOOTH );
-
+ glEnable(GL_LINE_SMOOTH);
+
link.fromnode = link.tonode = node;
- for (i=0; i < 3; ++i) {
- /* find input socket */
- for (link.fromsock=node->inputs.first; link.fromsock; link.fromsock=link.fromsock->next)
- if (link.fromsock->type==types[i] && nodeCountSocketLinks(snode->edittree, link.fromsock))
- break;
- if (link.fromsock) {
- for (link.tosock=node->outputs.first; link.tosock; link.tosock=link.tosock->next)
- if (link.tosock->type==types[i] && nodeCountSocketLinks(snode->edittree, link.tosock))
- break;
-
- if (link.tosock) {
- node_draw_link_bezier(v2d, snode, &link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE);
- }
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ for(i = 0; i < lnk->num_outs; i++) {
+ link.fromsock = (bNodeSocket*)(lnk->in);
+ link.tosock = (bNodeSocket*)(lnk->outs)+i;
+ node_draw_link_bezier(v2d, snode, &link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE);
}
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(i > 1)
+ MEM_freeN(lnk->outs);
}
-
+
glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
+
+ BLI_freelistN(&links);
}
/* this might have some more generic use */
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 23855ff24e1..cd4e99900e7 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -3283,7 +3283,8 @@ 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) {
- if(node->flag & SELECT) {
+ /* Only allow muting of nodes having a mute func! */
+ if((node->flag & SELECT) && node->typeinfo->mutefunc) {
/* Be able to mute in-/output nodes as well. - DingTo
if(node->inputs.first && node->outputs.first) { */
node->flag ^= NODE_MUTED;
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 593beedc765..c863efada9f 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -164,6 +164,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
rcti rect;
rctf rectf;
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");
@@ -180,6 +181,9 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
else
node->flag &= ~SELECT;
}
+ else if(!extend) {
+ node->flag &= ~SELECT;
+ }
}
node_sort(snode->edittree);
@@ -228,7 +232,7 @@ void NODE_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
RNA_def_boolean(ot->srna, "tweak", 0, "Tweak", "Only activate when mouse is not over a node - useful for tweak gesture");
}
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index fedb12f747c..c99a0be15dc 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -552,6 +552,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
bNode *lnode;
char label[UI_MAX_NAME_STR];
int indent = (depth > 1)? 2*(depth - 1): 0;
+ int dependency_loop;
if(input->flag & SOCK_UNAVAIL)
return;
@@ -560,6 +561,10 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
node->flag |= NODE_TEST;
lnode = (input->link)? input->link->fromnode: NULL;
+ dependency_loop = (lnode && (lnode->flag & NODE_TEST));
+ if(dependency_loop)
+ lnode = NULL;
+
/* socket RNA pointer */
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, input, &inputptr);
@@ -593,7 +598,11 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
bt= block->buttons.last;
bt->flag= UI_TEXT_LEFT;
- if(lnode) {
+ if(dependency_loop) {
+ row = uiLayoutRow(split, 0);
+ uiItemL(row, "Dependency Loop", ICON_ERROR);
+ }
+ else if(lnode) {
/* input linked to a node */
uiTemplateNodeLink(split, ntree, node, input);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index a4f67f91763..27ad2c4fd6d 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -236,6 +236,16 @@ static void unlink_group_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEleme
}
}
+static void unlink_world_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tsep, TreeStoreElem *tselem)
+{
+ Scene *parscene = (Scene *)tsep->id;
+ World *wo = (World *)tselem->id;
+
+ /* need to use parent scene not just scene, otherwise may end up getting wrong one */
+ id_us_min(&wo->id);
+ parscene->world = NULL;
+}
+
static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops *soops, ListBase *lb,
void (*operation_cb)(bContext *C, Scene *scene, TreeElement *, TreeStoreElem *, TreeStoreElem *))
{
@@ -350,6 +360,23 @@ static void singleuser_action_cb(bContext *C, Scene *UNUSED(scene), TreeElement
}
}
+static void singleuser_world_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tsep, TreeStoreElem *tselem)
+{
+ ID *id = tselem->id;
+
+ /* need to use parent scene not just scene, otherwise may end up getting wrong one */
+ if (id) {
+ Scene *parscene = (Scene *)tsep->id;
+ PointerRNA ptr = {{NULL}};
+ PropertyRNA *prop;
+
+ RNA_id_pointer_create(&parscene->id, &ptr);
+ prop = RNA_struct_find_property(&ptr, "world");
+
+ id_single_user(C, id, &ptr, prop);
+ }
+}
+
static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
{
Group *group= (Group *)tselem->id;
@@ -746,6 +773,12 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_OBJECT|ND_OB_SHADING, NULL);
ED_undo_push(C, "Unlink texture");
break;
+ case ID_WO:
+ outliner_do_libdata_operation(C, scene, soops, &soops->tree, unlink_world_cb);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_WORLD, NULL);
+ ED_undo_push(C, "Unlink world");
+ break;
default:
BKE_report(op->reports, RPT_WARNING, "Not Yet");
break;
@@ -772,6 +805,13 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Single-User Action");
break;
+ case ID_WO:
+ outliner_do_libdata_operation(C, scene, soops, &soops->tree, singleuser_world_cb);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_WORLD, NULL);
+ ED_undo_push(C, "Single-User World");
+ break;
+
default:
BKE_report(op->reports, RPT_WARNING, "Not Yet");
break;
@@ -799,12 +839,13 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
}
break;
case OUTLINER_IDOP_RENAME:
+ {
/* rename */
outliner_do_libdata_operation(C, scene, soops, &soops->tree, item_rename_cb);
-
+
WM_event_add_notifier(C, NC_ID|NA_EDITED, NULL);
ED_undo_push(C, "Rename");
-
+ }
break;
default:
@@ -1177,6 +1218,8 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
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)
+ /*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);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index d749371a636..9eb900ed427 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -827,6 +827,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
rcti rect;
rctf rectf, rq;
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)
@@ -852,6 +853,10 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
else seq->flag &= ~SEQ_ALLSEL;
recurs_sel_seq(seq);
}
+ else if(!extend) {
+ seq->flag &= ~SEQ_ALLSEL;
+ recurs_sel_seq(seq);
+ }
}
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
@@ -880,7 +885,7 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
/* ****** Selected Grouped ****** */
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index d59d947f0c8..2465d42bbf1 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1179,7 +1179,7 @@ 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= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
uiWidgetColors wcol= btheme->tui.wcol_scroll;
unsigned char col[4];
float rad;
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index c0046b089af..17cb1ce2995 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -115,7 +115,7 @@ 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= U.themes.first;
+ bTheme *btheme= UI_GetTheme();
bcolor= &btheme->tarm[(color_index - 1)];
}
else if (color_index == -1) {
@@ -1946,7 +1946,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
index+= 0x10000;
}
/* restore things */
- if ((arm->drawtype!=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);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 70cdefddc72..0ce2e891b6e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1693,7 +1693,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
if(cam->flag & CAM_SHOWLIMITS) {
draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF);
/* qdn: was yafray only, now also enabled for Blender to be used with defocus composit node */
- draw_focus_cross(dof_camera(ob), cam->drawsize);
+ draw_focus_cross(object_camera_dof_distance(ob), cam->drawsize);
}
wrld= scene->world;
@@ -2747,29 +2747,35 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
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);
+ /* if em has no faces the drawMappedFaces callback will fail */
+ if(em->faces.first) {
+ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
- draw_em_fancy__setGLSLFaceOpts, NULL);
- GPU_disable_material();
+ finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
+ draw_em_fancy__setGLSLFaceOpts, NULL);
+ GPU_disable_material();
- glFrontFace(GL_CCW);
+ glFrontFace(GL_CCW);
+ }
}
else {
draw_mesh_textured(scene, v3d, rv3d, ob, finalDM, 0);
}
}
else {
- /* 3 floats for position, 3 for normal and times two because the faces may actually be quads instead of triangles */
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
+ /* if em has no faces the drawMappedFaces callback will fail */
+ if(em->faces.first) {
+ /* 3 floats for position, 3 for normal and times two because the faces may actually be quads instead of triangles */
+ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
- glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glEnable(GL_LIGHTING);
+ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material, NULL);
+ finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material, NULL);
- glFrontFace(GL_CCW);
- glDisable(GL_LIGHTING);
+ glFrontFace(GL_CCW);
+ glDisable(GL_LIGHTING);
+ }
}
// Setup for drawing wire over, disable zbuffer
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index edcaed43de6..7dae02aba39 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -923,75 +923,48 @@ static void draw_selected_name(Scene *scene, Object *ob)
BLF_draw_default(offset, 10, 0.0f, info, sizeof(info)-1);
}
-void view3d_viewborder_size_get(Scene *scene, Object *camob, ARegion *ar, float size_r[2])
+static void view3d_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift, short no_zoom)
{
- float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
- short sensor_fit= CAMERA_SENSOR_FIT_AUTO;
-
- if(camob && camob->type==OB_CAMERA) {
- Camera *cam= (Camera *)camob->data;
- sensor_fit= cam->sensor_fit;
- }
+ CameraParams params;
+ rctf rect_view, rect_camera;
+
+ /* get viewport viewplane */
+ camera_params_init(&params);
+ camera_params_from_view3d(&params, v3d, rv3d);
+ if(no_zoom)
+ params.zoom= 1.0f;
+ camera_params_compute_viewplane(&params, ar->winx, ar->winy, 1.0f, 1.0f);
+ 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;
+ }
+ camera_params_compute_viewplane(&params, scene->r.xsch, scene->r.ysch, scene->r.xasp, scene->r.yasp);
+ 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;
+}
- if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- float winmax= MAX2(ar->winx, ar->winy);
+void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, float size_r[2])
+{
+ rctf viewborder;
- if(aspect > 1.0f) {
- size_r[0]= winmax;
- size_r[1]= winmax/aspect;
- } else {
- size_r[0]= winmax*aspect;
- size_r[1]= winmax;
- }
- }
- else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
- size_r[0]= ar->winx;
- size_r[1]= ar->winx/aspect;
- }
- else {
- size_r[0]= ar->winy*aspect;
- size_r[1]= ar->winy;
- }
+ view3d_camera_border(scene, ar, v3d, rv3d, &viewborder, TRUE, TRUE);
+ 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, rctf *viewborder_r, short do_shift)
+void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift)
{
- const float zoomfac= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom);
- float size[2];
- float dx= 0.0f, dy= 0.0f;
-
- view3d_viewborder_size_get(scene, v3d->camera, ar, size);
-
- size[0]= size[0]*zoomfac;
- size[1]= size[1]*zoomfac;
-
- /* center in window */
- viewborder_r->xmin= 0.5f * ar->winx - 0.5f * size[0];
- viewborder_r->ymin= 0.5f * ar->winy - 0.5f * size[1];
- viewborder_r->xmax= viewborder_r->xmin + size[0];
- viewborder_r->ymax= viewborder_r->ymin + size[1];
-
- dx= ar->winx*rv3d->camdx*zoomfac*2.0f;
- dy= ar->winy*rv3d->camdy*zoomfac*2.0f;
-
- /* apply offset */
- viewborder_r->xmin-= dx;
- viewborder_r->ymin-= dy;
- viewborder_r->xmax-= dx;
- viewborder_r->ymax-= dy;
-
- if(do_shift && v3d->camera && v3d->camera->type==OB_CAMERA) {
- Camera *cam= v3d->camera->data;
- float w = viewborder_r->xmax - viewborder_r->xmin;
- float h = viewborder_r->ymax - viewborder_r->ymin;
- float side = MAX2(w, h);
-
- if(do_shift == -1) side *= -1;
- viewborder_r->xmin+= cam->shiftx*side;
- viewborder_r->xmax+= cam->shiftx*side;
- viewborder_r->ymin+= cam->shifty*side;
- viewborder_r->ymax+= cam->shifty*side;
- }
+ view3d_camera_border(scene, ar, v3d, rv3d, viewborder_r, no_shift, FALSE);
}
static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float fac)
@@ -1228,19 +1201,39 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
uiDrawBox(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
}
if (ca && (ca->flag & CAM_SHOWSENSOR)) {
- /* assume fixed sensor width for now */
-
- /* float sensor_aspect = ca->sensor_x / ca->sensor_y; */ /* UNUSED */
- float sensor_scale = (x2i-x1i) / ca->sensor_x;
- float sensor_height = sensor_scale * ca->sensor_y;
+ /* 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;
+ 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;
+
+ /* determine sensor plane */
+ rctf rect;
+
+ if(sensor_fit == CAMERA_SENSOR_FIT_HOR) {
+ 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;
+ }
+ else {
+ float sensor_scale = (y2i-y1i) / sensor_y;
+ float sensor_width = sensor_scale * sensor_x;
- float ymid = y1i + (y2i-y1i)/2.f;
- float sy1= ymid - sensor_height/2.f;
- float sy2= ymid + sensor_height/2.f;
+ rect.xmin= (x1i + x2i)*0.5f - sensor_width*0.5f;
+ rect.xmax= rect.xmin + sensor_width;
+ rect.ymin= y1i;
+ rect.ymax= y2i;
+ }
+ /* draw */
UI_ThemeColorShade(TH_WIRE, 100);
-
- uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0f);
+ uiDrawBox(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax, 2.0f);
}
}
@@ -2485,15 +2478,14 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
/* render 3d view */
if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
- float winmat[4][4];
- float _clipsta, _clipend, _lens, _yco, _dx, _dy, _sensor_x= DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
- short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
- rctf _viewplane;
+ CameraParams params;
- object_camera_matrix(&scene->r, v3d->camera, sizex, sizey, 0, winmat, &_viewplane, &_clipsta, &_clipend, &_lens,
- &_sensor_x, &_sensor_y, &_sensor_fit, &_yco, &_dx, &_dy);
+ camera_params_init(&params);
+ camera_params_from_object(&params, v3d->camera);
+ 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, winmat);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, params.winmat);
}
else {
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, NULL);
@@ -2546,10 +2538,17 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
invert_m4_m4(rv3d.viewmat, rv3d.viewinv);
{
- float _yco, _dx, _dy, _sensor_x= DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
- short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
- rctf _viewplane;
- object_camera_matrix(&scene->r, v3d.camera, width, height, 0, rv3d.winmat, &_viewplane, &v3d.near, &v3d.far, &v3d.lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_yco, &_dx, &_dy);
+ CameraParams params;
+
+ camera_params_init(&params);
+ camera_params_from_object(&params, v3d.camera);
+ camera_params_compute_viewplane(&params, width, height, scene->r.xasp, scene->r.yasp);
+ camera_params_compute_matrix(&params);
+
+ copy_m4_m4(rv3d.winmat, params.winmat);
+ v3d.near= params.clipsta;
+ v3d.far= params.clipend;
+ v3d.lens= params.lens;
}
mul_m4_m4m4(rv3d.persmat, rv3d.viewmat, rv3d.winmat);
@@ -2878,6 +2877,10 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
else
draw_view_icon(rv3d);
+ ob= OBACT;
+ if(U.uiflag & USER_DRAWVIEWINFO)
+ draw_selected_name(scene, ob);
+
if(rv3d->render_engine) {
view3d_main_area_draw_engine_info(rv3d, ar);
return;
@@ -2899,10 +2902,6 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, tstr[0]?tstr : grid_unit, sizeof(tstr)); /* XXX, use real length */
}
-
- ob= OBACT;
- if(U.uiflag & USER_DRAWVIEWINFO)
- draw_selected_name(scene, ob);
}
void view3d_main_area_draw(const bContext *C, ARegion *ar)
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 0329b6c3739..32e162fd09c 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -47,6 +47,7 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_library.h"
@@ -1031,21 +1032,17 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
rv3d->view = RV3D_VIEW_USER;
if (U.flag & USER_TRACKBALL) {
- const int invert_roll = U.ndof_flag & NDOF_ROLL_INVERT_AXIS;
- const int invert_tilt = U.ndof_flag & NDOF_TILT_INVERT_AXIS;
- const int invert_rot = U.ndof_flag & NDOF_ROTATE_INVERT_AXIS;
-
float rot[4];
float axis[3];
float angle = rot_sensitivity * ndof_to_axis_angle(ndof, axis);
- if (invert_roll)
+ if (U.ndof_flag & NDOF_ROLL_INVERT_AXIS)
axis[2] = -axis[2];
- if (invert_tilt)
+ if (U.ndof_flag & NDOF_TILT_INVERT_AXIS)
axis[0] = -axis[0];
- if (invert_rot)
+ if (U.ndof_flag & NDOF_ROTATE_INVERT_AXIS)
axis[1] = -axis[1];
// transform rotation axis from view to world coordinates
@@ -1061,8 +1058,6 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, rot);
} else {
/* turntable view code by John Aughey, adapted for 3D mouse by [mce] */
- const int invert = U.ndof_flag & NDOF_ORBIT_INVERT_AXES;
-
float angle, rot[4];
float xvec[3] = {1,0,0};
@@ -1071,7 +1066,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
/* Perform the up/down rotation */
angle = rot_sensitivity * dt * ndof->rvec[0];
- if (invert)
+ if (U.ndof_flag & NDOF_TILT_INVERT_AXIS)
angle = -angle;
rot[0] = cos(angle);
mul_v3_v3fl(rot+1, xvec, sin(angle));
@@ -1079,7 +1074,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
/* Perform the orbital rotation */
angle = rot_sensitivity * dt * ndof->rvec[1];
- if (invert)
+ if (U.ndof_flag & NDOF_ROTATE_INVERT_AXIS)
angle = -angle;
// update the onscreen doo-dad
@@ -1164,23 +1159,19 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
const float vertical_sensitivity = 0.4f;
const float lateral_sensitivity = 0.6f;
- const int invert_panx = U.ndof_flag & NDOF_PANX_INVERT_AXIS;
- const int invert_pany = U.ndof_flag & NDOF_PANY_INVERT_AXIS;
- const int invert_panz = U.ndof_flag & NDOF_PANZ_INVERT_AXIS;
-
float pan_vec[3];
- if (invert_panx)
+ if (U.ndof_flag & NDOF_PANX_INVERT_AXIS)
pan_vec[0] = -lateral_sensitivity * ndof->tvec[0];
else
pan_vec[0] = lateral_sensitivity * ndof->tvec[0];
- if (invert_panz)
+ if (U.ndof_flag & NDOF_PANZ_INVERT_AXIS)
pan_vec[1] = -vertical_sensitivity * ndof->tvec[1];
else
pan_vec[1] = vertical_sensitivity * ndof->tvec[1];
- if (invert_pany)
+ if (U.ndof_flag & NDOF_PANY_INVERT_AXIS)
pan_vec[2] = -forward_sensitivity * ndof->tvec[2];
else
pan_vec[2] = forward_sensitivity * ndof->tvec[2];
@@ -2275,7 +2266,7 @@ static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was
rv3d->camdx= rv3d->camdy= 0.0f;
- view3d_viewborder_size_get(scene, v3d->camera, ar, size);
+ 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);
@@ -2543,7 +2534,7 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d)
float size[2];
int im_width= (scene->r.size*scene->r.xsch)/100;
- view3d_viewborder_size_get(scene, v3d->camera, ar, size);
+ ED_view3d_calc_camera_border_size(scene, ar, v3d, rv3d, size);
rv3d->camzoom= BKE_screen_view3d_zoom_from_fac((float)im_width/size[0]);
CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
@@ -2954,7 +2945,7 @@ static BGpic *background_image_add(bContext *C)
{
View3D *v3d= CTX_wm_view3d(C);
- return ED_view3D_background_image_add(v3d);
+ return ED_view3D_background_image_new(v3d);
}
static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3024,16 +3015,13 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
/* ***** remove image operator ******* */
static int background_image_remove_exec(bContext *C, wmOperator *op)
{
- View3D *vd = CTX_wm_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
int index = RNA_int_get(op->ptr, "index");
- BGpic *bgpic_rem= BLI_findlink(&vd->bgpicbase, index);
+ BGpic *bgpic_rem= BLI_findlink(&v3d->bgpicbase, index);
if(bgpic_rem) {
- BLI_remlink(&vd->bgpicbase, bgpic_rem);
- if(bgpic_rem->ima) id_us_min(&bgpic_rem->ima->id);
- if(bgpic_rem->clip) id_us_min(&bgpic_rem->clip->id);
- MEM_freeN(bgpic_rem);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd);
+ ED_view3D_background_image_remove(v3d, bgpic_rem);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
else {
@@ -3526,8 +3514,12 @@ void ED_view3d_from_object(Object *ob, float ofs[3], float quat[4], float *dist,
{
ED_view3d_from_m4(ob->obmat, ofs, quat, dist);
- if (lens) {
- ED_view3d_ob_clip_range_get(ob, lens, NULL, NULL);
+ if(lens) {
+ CameraParams params;
+
+ camera_params_init(&params);
+ camera_params_from_object(&params, ob);
+ *lens= params.lens;
}
}
@@ -3539,7 +3531,7 @@ void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], co
object_apply_mat4(ob, mat, TRUE, TRUE);
}
-BGpic *ED_view3D_background_image_add(View3D *v3d)
+BGpic *ED_view3D_background_image_new(View3D *v3d)
{
BGpic *bgpic= MEM_callocN(sizeof(BGpic), "Background Image");
@@ -3548,8 +3540,22 @@ BGpic *ED_view3D_background_image_add(View3D *v3d)
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);
return bgpic;
}
+
+void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic)
+{
+ BLI_remlink(&v3d->bgpicbase, bgpic);
+
+ if(bgpic->ima)
+ id_us_min(&bgpic->ima->id);
+
+ if(bgpic->clip)
+ id_us_min(&bgpic->clip->id);
+
+ MEM_freeN(bgpic);
+}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 6eafb10d74c..b9513ab0880 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -490,10 +490,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
else
v3d->modeselect = OB_MODE_OBJECT;
- uiBlockBeginAlign(block);
+ 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"));
- uiBlockEndAlign(block);
/* Draw type */
uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index fa2d5db21df..42f58ba26f7 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -140,7 +140,6 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
void view3d_clr_clipping(void);
void view3d_set_clipping(RegionView3D *rv3d);
void add_view3d_after(ListBase *lb, Base *base, int flag);
-void view3d_viewborder_size_get(struct Scene *scene, struct Object *camob, struct ARegion *ar, float size_r[2]);
void circf(float x, float y, float rad);
void circ(float x, float y, float rad);
@@ -155,7 +154,8 @@ void VIEW3D_OT_select_border(struct wmOperatorType *ot);
void VIEW3D_OT_select_lasso(struct wmOperatorType *ot);
void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
-void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot);
+void VIEW3D_OT_camera_to_view(struct wmOperatorType *ot);
+void VIEW3D_OT_camera_to_view_selected(struct wmOperatorType *ot);
void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot);
void VIEW3D_OT_localview(struct wmOperatorType *ot);
void VIEW3D_OT_game_start(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 6e26fb15873..aeb850243c5 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -85,7 +85,8 @@ void view3d_operatortypes(void)
WM_operatortype_append(VIEW3D_OT_enable_manipulator);
WM_operatortype_append(VIEW3D_OT_cursor3d);
WM_operatortype_append(VIEW3D_OT_select_lasso);
- WM_operatortype_append(VIEW3D_OT_setcameratoview);
+ WM_operatortype_append(VIEW3D_OT_camera_to_view);
+ WM_operatortype_append(VIEW3D_OT_camera_to_view_selected);
WM_operatortype_append(VIEW3D_OT_object_as_camera);
WM_operatortype_append(VIEW3D_OT_localview);
WM_operatortype_append(VIEW3D_OT_game_start);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index cc0e93740ea..90f617513a5 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -43,6 +43,7 @@
#include "BKE_anim.h"
#include "BKE_action.h"
+#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_object.h"
@@ -103,31 +104,6 @@ float *give_cursor(Scene *scene, View3D *v3d)
}
-/* Gets the lens and clipping values from a camera of lamp type object */
-void ED_view3d_ob_clip_range_get(Object *ob, float *lens, float *clipsta, float *clipend)
-{
- if(ob->type==OB_LAMP ) {
- Lamp *la = ob->data;
- if (lens) {
- float x1, fac;
- fac= cosf((float)M_PI*la->spotsize/360.0f);
- x1= saacos(fac);
- *lens= 16.0f*fac/sinf(x1);
- }
- if (clipsta) *clipsta= la->clipsta;
- if (clipend) *clipend= la->clipend;
- }
- else if(ob->type==OB_CAMERA) {
- Camera *cam= ob->data;
- if (lens) *lens= cam->lens;
- if (clipsta) *clipsta= cam->clipsta;
- if (clipend) *clipend= cam->clipend;
- }
- else {
- if (lens) *lens= 35.0f;
- }
-}
-
/* ****************** smooth view operator ****************** */
/* This operator is one of the 'timer refresh' ones like animation playback */
@@ -366,7 +342,7 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
/* ****************** change view operators ****************** */
-static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op))
+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);
@@ -393,7 +369,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op))
}
-static int view3d_setcameratoview_poll(bContext *C)
+static int view3d_camera_to_view_poll(bContext *C)
{
View3D *v3d= CTX_wm_view3d(C);
if(v3d && v3d->camera && v3d->camera->id.lib==NULL) {
@@ -406,22 +382,88 @@ static int view3d_setcameratoview_poll(bContext *C)
return 0;
}
-void VIEW3D_OT_setcameratoview(wmOperatorType *ot)
+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";
/* api callbacks */
- ot->exec= view3d_setcameratoview_exec;
- ot->poll= view3d_setcameratoview_poll;
+ ot->exec= view3d_camera_to_view_exec;
+ ot->poll= view3d_camera_to_view_poll;
/* flags */
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);
+ View3D *v3d = CTX_wm_view3d(C);
+ Object *camera_ob= v3d->camera;
+
+ float r_co[3]; /* the new location to apply */
+
+ /* this function does all the important stuff */
+ if (camera_view_frame_fit_to_scene(scene, v3d, camera_ob, r_co)) {
+
+ ObjectTfmProtectedChannels obtfm;
+ float obmat_new[4][4];
+
+ copy_m4_m4(obmat_new, camera_ob->obmat);
+ copy_v3_v3(obmat_new[3], r_co);
+
+ /* only touch location */
+ object_tfm_protected_backup(camera_ob, &obtfm);
+ object_apply_mat4(camera_ob, obmat_new, TRUE, TRUE);
+ object_tfm_protected_restore(camera_ob, &obtfm, OB_LOCK_SCALE | OB_LOCK_ROT4D);
+
+ /* notifiers */
+ DAG_id_tag_update(&camera_ob->id, OB_RECALC_OB);
+ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, camera_ob);
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+}
+
+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);
+ if(rv3d) {
+ if (rv3d->is_persp == FALSE) {
+ CTX_wm_operator_poll_msg_set(C, "Only valid for a perspective camera view");
+ }
+ else if (!rv3d->viewlock) {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+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";
+
+ /* api callbacks */
+ ot->exec= view3d_camera_to_view_selected_exec;
+ ot->poll= view3d_camera_to_view_selected_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -461,7 +503,7 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
ot->idname= "VIEW3D_OT_object_as_camera";
/* api callbacks */
- ot->exec= view3d_setobjectascamera_exec;
+ ot->exec= view3d_setobjectascamera_exec;
ot->poll= ED_operator_rv3d_unlock_poll;
/* flags */
@@ -936,202 +978,31 @@ void project_float_noclip(ARegion *ar, const float vec[3], float adr[2])
/* copies logic of get_view3d_viewplane(), keep in sync */
int ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
{
- int orth= 0;
+ CameraParams params;
- *clipsta= v3d->near;
- *clipend= v3d->far;
+ camera_params_init(&params);
+ camera_params_from_view3d(&params, v3d, rv3d);
- if(rv3d->persp==RV3D_CAMOB) {
- if(v3d->camera) {
- if(v3d->camera->type==OB_LAMP ) {
- Lamp *la= v3d->camera->data;
- *clipsta= la->clipsta;
- *clipend= la->clipend;
- }
- else if(v3d->camera->type==OB_CAMERA) {
- Camera *cam= v3d->camera->data;
- *clipsta= cam->clipsta;
- *clipend= cam->clipend;
-
- if(cam->type==CAM_ORTHO)
- orth= 1;
- }
- }
- }
-
- if(rv3d->persp==RV3D_ORTHO) {
- *clipend *= 0.5f; // otherwise too extreme low zbuffer quality
- *clipsta= - *clipend;
- orth= 1;
- }
+ if(clipsta) *clipsta= params.clipsta;
+ if(clipend) *clipend= params.clipend;
- return orth;
+ return params.is_ortho;
}
/* also exposed in previewrender.c */
-int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
+int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winx, int winy, rctf *viewplane, float *clipsta, float *clipend)
{
- Camera *cam=NULL;
- float lens, sensor_x =DEFAULT_SENSOR_WIDTH, sensor_y= DEFAULT_SENSOR_HEIGHT, fac, x1, y1, x2, y2;
- float winx= (float)winxi, winy= (float)winyi;
- int orth= 0;
- short sensor_fit= CAMERA_SENSOR_FIT_AUTO;
+ CameraParams params;
- /* currnetly using sensor size (depends on fov calculating method) */
- float sensor= DEFAULT_SENSOR_WIDTH;
+ camera_params_init(&params);
+ camera_params_from_view3d(&params, v3d, rv3d);
+ camera_params_compute_viewplane(&params, winx, winy, 1.0f, 1.0f);
- lens= v3d->lens;
-
- *clipsta= v3d->near;
- *clipend= v3d->far;
-
- if(rv3d->persp==RV3D_CAMOB) {
- if(v3d->camera) {
- if(v3d->camera->type==OB_LAMP ) {
- Lamp *la;
-
- la= v3d->camera->data;
- fac= cosf(((float)M_PI)*la->spotsize/360.0f);
-
- x1= saacos(fac);
- lens= 16.0f*fac/sinf(x1);
-
- *clipsta= la->clipsta;
- *clipend= la->clipend;
- }
- else if(v3d->camera->type==OB_CAMERA) {
- cam= v3d->camera->data;
- lens= cam->lens;
- sensor_x= cam->sensor_x;
- sensor_y= cam->sensor_y;
- *clipsta= cam->clipsta;
- *clipend= cam->clipend;
- sensor_fit= cam->sensor_fit;
-
- sensor= (cam->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : (cam->sensor_x);
- }
- }
- }
-
- if(rv3d->persp==RV3D_ORTHO) {
- if(winx>winy) x1= -rv3d->dist;
- else x1= -winx*rv3d->dist/winy;
- x2= -x1;
-
- if(winx>winy) y1= -winy*rv3d->dist/winx;
- else y1= -rv3d->dist;
- y2= -y1;
-
- *clipend *= 0.5f; // otherwise too extreme low zbuffer quality
- *clipsta= - *clipend;
- orth= 1;
- }
- else {
- /* fac for zoom, also used for camdx */
- if(rv3d->persp==RV3D_CAMOB) {
- fac= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom) * 4.0f;
- }
- else {
- fac= 2.0;
- }
-
- /* viewplane size depends... */
- if(cam && cam->type==CAM_ORTHO) {
- /* ortho_scale == 1 means exact 1 to 1 mapping */
- float dfac= 2.0f*cam->ortho_scale/fac;
-
- if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- if(winx>winy) {
- x1= -dfac;
- y1= -winy*dfac/winx;
- }
- else {
- x1= -winx*dfac/winy;
- y1= -dfac;
- }
- }
- else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
- x1= -dfac;
- y1= -winy*dfac/winx;
- }
- else {
- x1= -winx*dfac/winy;
- y1= -dfac;
- }
-
- x2= -x1;
- y2= -y1;
-
- orth= 1;
- }
- else {
- float dfac;
-
- if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- if(winx>winy) dfac= (sensor_x * 2.0f) / (fac*winx*lens);
- else dfac= (sensor_x * 2.0f) / (fac*winy*lens);
- }
- else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
- dfac= (sensor_x * 2.0f) / (fac*winx*lens);
- }
- else {
- dfac= (sensor_y * 2.0f) / (fac*winy*lens);
- }
-
- x1= - *clipsta * winx*dfac;
- x2= -x1;
- y1= - *clipsta * winy*dfac;
- y2= -y1;
- orth= 0;
- }
- /* cam view offset */
- if(cam) {
- float dx= 0.5f*fac*rv3d->camdx*(x2-x1);
- float dy= 0.5f*fac*rv3d->camdy*(y2-y1);
-
- /* shift offset */
- if(cam->type==CAM_ORTHO) {
- dx += cam->shiftx * cam->ortho_scale;
- dy += cam->shifty * cam->ortho_scale;
- }
- else {
- dx += cam->shiftx * (cam->clipsta / cam->lens) * sensor;
- dy += cam->shifty * (cam->clipsta / cam->lens) * sensor;
- }
-
- x1+= dx;
- x2+= dx;
- y1+= dy;
- y2+= dy;
- }
- }
-
- if(pixsize) {
- float viewfac;
-
- if(orth) {
- viewfac= (winx >= winy)? winx: winy;
- *pixsize= 1.0f/viewfac;
- }
- else {
- float size= ((winx >= winy)? winx: winy);
-
- if(sensor_fit==CAMERA_SENSOR_FIT_HOR)
- size= winx;
- else if(sensor_fit==CAMERA_SENSOR_FIT_VERT)
- size= winy;
-
- viewfac= (size*lens)/sensor;
- *pixsize= *clipsta/viewfac;
- }
- }
-
- viewplane->xmin= x1;
- viewplane->ymin= y1;
- viewplane->xmax= x2;
- viewplane->ymax= y2;
+ if(viewplane) *viewplane= params.viewplane;
+ if(clipsta) *clipsta= params.clipsta;
+ if(clipend) *clipend= params.clipend;
- return orth;
+ return params.is_ortho;
}
void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for picking */
@@ -1141,7 +1012,7 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick
float clipsta, clipend, x1, y1, x2, y2;
int orth;
- orth= ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
+ orth= ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend);
rv3d->is_persp= !orth;
// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index a50a1a6910e..35d9aed3691 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -93,8 +93,8 @@
#include "transform.h"
-void drawTransformApply(const struct bContext *C, struct ARegion *ar, void *arg);
-int doEdgeSlide(TransInfo *t, float perc);
+static void drawTransformApply(const struct bContext *C, struct ARegion *ar, void *arg);
+static int doEdgeSlide(TransInfo *t, float perc);
/* ************************** SPACE DEPENDANT CODE **************************** */
@@ -1784,7 +1784,7 @@ void transformApply(bContext *C, TransInfo *t)
t->context = NULL;
}
-void drawTransformApply(const bContext *C, struct ARegion *UNUSED(ar), void *arg)
+static void drawTransformApply(const bContext *C, struct ARegion *UNUSED(ar), void *arg)
{
TransInfo *t = arg;
@@ -4840,7 +4840,7 @@ void initEdgeSlide(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT;
}
-int doEdgeSlide(TransInfo *t, float perc)
+static int doEdgeSlide(TransInfo *t, float perc)
{
SlideData *sld = t->customData;
EditVert *ev, *nearest = sld->nearest;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 3a8c2e80351..72f10a532d7 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1548,14 +1548,26 @@ void calculateCenter(TransInfo *t)
/* EDIT MODE ACTIVE EDITMODE ELEMENT */
- if (t->obedit && t->obedit->type == OB_MESH) {
- EditSelection ese;
- EditMesh *em = BKE_mesh_get_editmesh(t->obedit->data);
+ if (t->obedit) {
+ if(t->obedit->type == OB_MESH) {
+ EditSelection ese;
+ EditMesh *em = BKE_mesh_get_editmesh(t->obedit->data);
- if (EM_get_actSelection(em, &ese)) {
- EM_editselection_center(t->center, &ese);
- calculateCenter2D(t);
- break;
+ if (EM_get_actSelection(em, &ese)) {
+ EM_editselection_center(t->center, &ese);
+ calculateCenter2D(t);
+ break;
+ }
+ }
+ else if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) {
+ float center[3];
+ Curve *cu= (Curve *)t->obedit->data;
+
+ if (ED_curve_actSelection(cu, center)) {
+ copy_v3_v3(t->center, center);
+ calculateCenter2D(t);
+ break;
+ }
}
} /* END EDIT MODE ACTIVE ELEMENT */
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 5b275a572cb..63495d54cf1 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -71,6 +71,7 @@
#include "WM_types.h"
#include "ED_armature.h"
+#include "ED_curve.h"
#include "ED_mesh.h"
#include "ED_particle.h"
#include "ED_view3d.h"
@@ -390,56 +391,64 @@ int calc_manipulator_stats(const bContext *C)
}
else if ELEM(obedit->type, OB_CURVE, OB_SURF) {
Curve *cu= obedit->data;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- ListBase *nurbs= curve_editnurbs(cu);
-
- nu= nurbs->first;
- while(nu) {
- if(nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- 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.
- */
- if (cu->drawflag & CU_HIDE_HANDLES) {
- if (bezt->f2 & SELECT) {
- calc_tw_center(scene, bezt->vec[1]);
- totsel++;
+ float center[3];
+
+ if (v3d->around==V3D_ACTIVE && ED_curve_actSelection(cu, center)) {
+ calc_tw_center(scene, center);
+ totsel++;
+ }
+ else {
+ Nurb *nu;
+ BezTriple *bezt;
+ BPoint *bp;
+ ListBase *nurbs= curve_editnurbs(cu);
+
+ nu= nurbs->first;
+ while(nu) {
+ if(nu->type == CU_BEZIER) {
+ bezt= nu->bezt;
+ a= nu->pntsu;
+ 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.
+ */
+ if (cu->drawflag & CU_HIDE_HANDLES) {
+ if (bezt->f2 & SELECT) {
+ calc_tw_center(scene, bezt->vec[1]);
+ totsel++;
+ }
}
- }
- else if (bezt->f2 & SELECT) {
- calc_tw_center(scene, bezt->vec[1]);
- totsel++;
- }
- else {
- if(bezt->f1) {
- calc_tw_center(scene, bezt->vec[0]);
+ else if (bezt->f2 & SELECT) {
+ calc_tw_center(scene, bezt->vec[1]);
totsel++;
}
- if(bezt->f3) {
- calc_tw_center(scene, bezt->vec[2]);
- totsel++;
+ else {
+ if(bezt->f1) {
+ calc_tw_center(scene, bezt->vec[0]);
+ totsel++;
+ }
+ if(bezt->f3) {
+ calc_tw_center(scene, bezt->vec[2]);
+ totsel++;
+ }
}
+ bezt++;
}
- bezt++;
}
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- calc_tw_center(scene, bp->vec);
- totsel++;
+ else {
+ bp= nu->bp;
+ a= nu->pntsu*nu->pntsv;
+ while(a--) {
+ if(bp->f1 & SELECT) {
+ calc_tw_center(scene, bp->vec);
+ totsel++;
+ }
+ bp++;
}
- bp++;
}
+ nu= nu->next;
}
- nu= nu->next;
}
}
else if(obedit->type==OB_MBALL) {
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index fa19d12d5ad..4635411dcdf 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -90,23 +90,23 @@
/********************* PROTOTYPES ***********************/
-void setSnappingCallback(TransInfo *t);
+static void setSnappingCallback(TransInfo *t);
-void ApplySnapTranslation(TransInfo *t, float vec[3]);
-void ApplySnapRotation(TransInfo *t, float *vec);
-void ApplySnapResize(TransInfo *t, float *vec);
+static void ApplySnapTranslation(TransInfo *t, float vec[3]);
+static void ApplySnapRotation(TransInfo *t, float *vec);
+static void ApplySnapResize(TransInfo *t, float vec[2]);
-void CalcSnapGrid(TransInfo *t, float *vec);
-void CalcSnapGeometry(TransInfo *t, float *vec);
+/* static void CalcSnapGrid(TransInfo *t, float *vec); */
+static void CalcSnapGeometry(TransInfo *t, float *vec);
-void TargetSnapMedian(TransInfo *t);
-void TargetSnapCenter(TransInfo *t);
-void TargetSnapClosest(TransInfo *t);
-void TargetSnapActive(TransInfo *t);
+static void TargetSnapMedian(TransInfo *t);
+static void TargetSnapCenter(TransInfo *t);
+static void TargetSnapClosest(TransInfo *t);
+static void TargetSnapActive(TransInfo *t);
-float RotationBetween(TransInfo *t, float p1[3], float p2[3]);
-float TranslationBetween(TransInfo *t, float p1[3], float p2[3]);
-float ResizeBetween(TransInfo *t, float p1[3], float p2[3]);
+static float RotationBetween(TransInfo *t, float p1[3], float p2[3]);
+static float TranslationBetween(TransInfo *t, float p1[3], float p2[3]);
+static float ResizeBetween(TransInfo *t, float p1[3], float p2[3]);
/****************** IMPLEMENTATIONS *********************/
@@ -483,7 +483,7 @@ void initSnapping(TransInfo *t, wmOperator *op)
initSnappingMode(t);
}
-void setSnappingCallback(TransInfo *t)
+static void setSnappingCallback(TransInfo *t)
{
t->tsnap.calcSnap = CalcSnapGeometry;
@@ -584,14 +584,14 @@ void getSnapPoint(TransInfo *t, float vec[3])
/********************** APPLY **************************/
-void ApplySnapTranslation(TransInfo *t, float vec[3])
+static void ApplySnapTranslation(TransInfo *t, float vec[3])
{
float point[3];
getSnapPoint(t, point);
sub_v3_v3v3(vec, point, t->tsnap.snapTarget);
}
-void ApplySnapRotation(TransInfo *t, float *vec)
+static void ApplySnapRotation(TransInfo *t, float *vec)
{
if (t->tsnap.target == SCE_SNAP_TARGET_CLOSEST) {
*vec = t->tsnap.dist;
@@ -603,7 +603,7 @@ void ApplySnapRotation(TransInfo *t, float *vec)
}
}
-void ApplySnapResize(TransInfo *t, float vec[3])
+static void ApplySnapResize(TransInfo *t, float vec[3])
{
if (t->tsnap.target == SCE_SNAP_TARGET_CLOSEST) {
vec[0] = vec[1] = vec[2] = t->tsnap.dist;
@@ -617,12 +617,12 @@ void ApplySnapResize(TransInfo *t, float vec[3])
/********************** DISTANCE **************************/
-float TranslationBetween(TransInfo *UNUSED(t), float p1[3], float p2[3])
+static float TranslationBetween(TransInfo *UNUSED(t), float p1[3], float p2[3])
{
return len_v3v3(p1, p2);
}
-float RotationBetween(TransInfo *t, float p1[3], float p2[3])
+static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
{
float angle, start[3], end[3], center[3];
@@ -678,7 +678,7 @@ float RotationBetween(TransInfo *t, float p1[3], float p2[3])
return angle;
}
-float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
+static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
{
float d1[3], d2[3], center[3];
@@ -701,12 +701,12 @@ float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
/********************** CALC **************************/
-void CalcSnapGrid(TransInfo *t, float *UNUSED(vec))
+static void UNUSED_FUNCTION(CalcSnapGrid)(TransInfo *t, float *UNUSED(vec))
{
snapGridAction(t, t->tsnap.snapPoint, BIG_GEARS);
}
-void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
+static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
{
if (t->spacetype == SPACE_VIEW3D)
{
@@ -866,7 +866,7 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
/********************** TARGET **************************/
-void TargetSnapCenter(TransInfo *t)
+static void TargetSnapCenter(TransInfo *t)
{
// Only need to calculate once
if ((t->tsnap.status & TARGET_INIT) == 0)
@@ -881,7 +881,7 @@ void TargetSnapCenter(TransInfo *t)
}
}
-void TargetSnapActive(TransInfo *t)
+static void TargetSnapActive(TransInfo *t)
{
// Only need to calculate once
if ((t->tsnap.status & TARGET_INIT) == 0)
@@ -920,7 +920,7 @@ void TargetSnapActive(TransInfo *t)
}
}
-void TargetSnapMedian(TransInfo *t)
+static void TargetSnapMedian(TransInfo *t)
{
// Only need to calculate once
if ((t->tsnap.status & TARGET_INIT) == 0)
@@ -948,7 +948,7 @@ void TargetSnapMedian(TransInfo *t)
}
}
-void TargetSnapClosest(TransInfo *t)
+static void TargetSnapClosest(TransInfo *t)
{
// Only valid if a snap point has been selected
if (t->tsnap.status & POINT_INIT)
@@ -1035,7 +1035,7 @@ void TargetSnapClosest(TransInfo *t)
}
/*================================================================*/
#ifndef USE_BVH_FACE_SNAP
-static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], float *v4co, float mval[2], float ray_start[3], float ray_start_local[3], float ray_normal_local[3], float obmat[][4], float timat[][3], float *loc, float *no, int *dist, float *depth)
+static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], float *v4co, float mval[2], float ray_start[3], float ray_start_local[3], float ray_normal_local[3], float obmat[][4], float timat[][3], float loc[3], float no[3], int *dist, float *depth)
{
float lambda;
int result;
@@ -1087,7 +1087,9 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl
}
#endif
-static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], short v2no[3], float mval[2], float ray_start[3], float ray_start_local[3], float ray_normal_local[3], float obmat[][4], float timat[][3], float *loc, float *no, int *dist, float *depth)
+static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], short v2no[3], float obmat[][4], float timat[][3],
+ const float ray_start[3], const float ray_start_local[3], const float ray_normal_local[3], const float mval[2],
+ float r_loc[3], float r_no[3], int *r_dist, float *r_depth)
{
float intersect[3] = {0, 0, 0}, ray_end[3], dvec[3];
int result;
@@ -1141,11 +1143,11 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
* this takes care of series of connected edges a bit slanted w.r.t the viewport
* otherwise, it would stick to the verts of the closest edge and not slide along merrily
* */
- if (new_dist <= *dist && new_depth < *depth * 1.001f)
+ if (new_dist <= *r_dist && new_depth < *r_depth * 1.001f)
{
float n1[3], n2[3];
- *depth = new_depth;
+ *r_depth = new_depth;
retval = 1;
sub_v3_v3v3(edge_loc, v1co, v2co);
@@ -1153,18 +1155,18 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
mul = dot_v3v3(vec, edge_loc) / dot_v3v3(edge_loc, edge_loc);
- if (no)
+ if (r_no)
{
normal_short_to_float_v3(n1, v1no);
normal_short_to_float_v3(n2, v2no);
- interp_v3_v3v3(no, n2, n1, mul);
- mul_m3_v3(timat, no);
- normalize_v3(no);
+ interp_v3_v3v3(r_no, n2, n1, mul);
+ mul_m3_v3(timat, r_no);
+ normalize_v3(r_no);
}
- copy_v3_v3(loc, location);
+ copy_v3_v3(r_loc, location);
- *dist = new_dist;
+ *r_dist = new_dist;
}
}
}
@@ -1172,7 +1174,9 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
return retval;
}
-static int snapVertex(ARegion *ar, float vco[3], short vno[3], float mval[2], float ray_start[3], float ray_start_local[3], float ray_normal_local[3], float obmat[][4], float timat[][3], float *loc, float *no, int *dist, float *depth)
+static int snapVertex(ARegion *ar, float vco[3], short vno[3], float obmat[][4], float timat[][3],
+ const float ray_start[3], const float ray_start_local[3], const float ray_normal_local[3], const float mval[2],
+ float r_loc[3], float r_no[3], int *r_dist, float *r_depth)
{
int retval = 0;
float dvec[3];
@@ -1190,33 +1194,35 @@ static int snapVertex(ARegion *ar, float vco[3], short vno[3], float mval[2], fl
mul_m4_v3(obmat, location);
- new_depth = len_v3v3(location, ray_start);
+ new_depth = len_v3v3(location, ray_start);
project_int(ar, location, screen_loc);
new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]);
- if (new_dist <= *dist && new_depth < *depth)
+ if (new_dist <= *r_dist && new_depth < *r_depth)
{
- *depth = new_depth;
+ *r_depth = new_depth;
retval = 1;
- copy_v3_v3(loc, location);
+ copy_v3_v3(r_loc, location);
- if (no)
+ if (r_no)
{
- normal_short_to_float_v3(no, vno);
- mul_m3_v3(timat, no);
- normalize_v3(no);
+ normal_short_to_float_v3(r_no, vno);
+ mul_m3_v3(timat, r_no);
+ normalize_v3(r_no);
}
- *dist = new_dist;
+ *r_dist = new_dist;
}
}
return retval;
}
-static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], float *loc, float *UNUSED(no), int *dist, float *depth)
+static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm, float obmat[][4],
+ const float ray_start[3], const float ray_normal[3], const float mval[2],
+ float r_loc[3], float *UNUSED(r_no), int *r_dist, float *r_depth)
{
float imat[4][4];
float ray_start_local[3], ray_normal_local[3];
@@ -1241,11 +1247,11 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
switch (snap_mode)
{
case SCE_SNAP_MODE_VERTEX:
- retval |= snapVertex(ar, eBone->head, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
- retval |= snapVertex(ar, eBone->tail, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
+ retval |= snapVertex(ar, eBone->head, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
+ retval |= snapVertex(ar, eBone->tail, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
break;
case SCE_SNAP_MODE_EDGE:
- retval |= snapEdge(ar, eBone->head, NULL, eBone->tail, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
+ retval |= snapEdge(ar, eBone->head, NULL, eBone->tail, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
break;
}
}
@@ -1267,11 +1273,11 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
switch (snap_mode)
{
case SCE_SNAP_MODE_VERTEX:
- retval |= snapVertex(ar, head_vec, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
- retval |= snapVertex(ar, tail_vec, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
+ retval |= snapVertex(ar, head_vec, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
+ retval |= snapVertex(ar, tail_vec, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
break;
case SCE_SNAP_MODE_EDGE:
- retval |= snapEdge(ar, head_vec, NULL, tail_vec, NULL, mval, ray_start, ray_start_local, ray_normal_local, obmat, NULL, loc, NULL, dist, depth);
+ retval |= snapEdge(ar, head_vec, NULL, tail_vec, NULL, obmat, NULL, ray_start, ray_start_local, ray_normal_local, mval, r_loc, NULL, r_dist, r_depth);
break;
}
}
@@ -1281,7 +1287,9 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
return retval;
}
-static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh *dm, EditMesh *em, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], float *loc, float *no, int *dist, float *depth)
+static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh *dm, EditMesh *em, float obmat[][4],
+ const float ray_start[3], const float ray_normal[3], const float mval[2],
+ float r_loc[3], float r_no[3], int *r_dist, float *r_depth)
{
int retval = 0;
int totvert = dm->getNumVerts(dm);
@@ -1330,21 +1338,21 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 6);
hit.index = -1;
- hit.dist = *depth * (*depth == FLT_MAX ? 1.0f : local_scale);
+ 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(hit.dist/local_scale <= *depth) {
- *depth= hit.dist/local_scale;
- copy_v3_v3(loc, hit.co);
- copy_v3_v3(no, hit.no);
+ 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);
/* back to worldspace */
- mul_m4_v3(obmat, loc);
- copy_v3_v3(no, hit.no);
+ mul_m4_v3(obmat, r_loc);
+ copy_v3_v3(r_no, hit.no);
- mul_m3_v3(timat, no);
- normalize_v3(no);
+ mul_m3_v3(timat, r_no);
+ normalize_v3(r_no);
retval |= 1;
}
@@ -1472,7 +1480,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (test)
{
- retval |= snapVertex(ar, v->co, v->no, mval, ray_start, ray_start_local, ray_normal_local, obmat, timat, loc, no, dist, depth);
+ retval |= snapVertex(ar, v->co, v->no, obmat, timat, ray_start, ray_start_local, ray_normal_local, mval, r_loc, r_no, r_dist, r_depth);
}
}
@@ -1532,7 +1540,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (test)
{
- retval |= snapEdge(ar, verts[e->v1].co, verts[e->v1].no, verts[e->v2].co, verts[e->v2].no, mval, ray_start, ray_start_local, ray_normal_local, obmat, timat, loc, no, dist, depth);
+ retval |= snapEdge(ar, verts[e->v1].co, verts[e->v1].no, verts[e->v2].co, verts[e->v2].no, obmat, timat, ray_start, ray_start_local, ray_normal_local, mval, r_loc, r_no, r_dist, r_depth);
}
}
@@ -1549,7 +1557,9 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
return retval;
}
-static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], float *loc, float *no, int *dist, float *depth)
+static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obmat[][4],
+ const float ray_start[3], const float ray_normal[3], const float mval[2],
+ float r_loc[3], float r_no[3], int *r_dist, float *r_depth)
{
ToolSettings *ts= scene->toolsettings;
int retval = 0;
@@ -1570,19 +1580,20 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
}
- retval = snapDerivedMesh(ts->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, loc, no, dist, depth);
+ retval = snapDerivedMesh(ts->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, r_depth);
dm->release(dm);
}
else if (ob->type == OB_ARMATURE)
{
- retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, loc, no, dist, depth);
+ retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, r_depth);
}
return retval;
}
-static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mval[2], int *dist, float *loc, float *no, SnapMode mode)
+static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, const float mval[2],
+ int *r_dist, float r_loc[3], float r_no[3], SnapMode mode)
{
Base *base;
float depth = FLT_MAX;
@@ -1595,7 +1606,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, f
{
Object *ob = obedit;
- retval |= snapObject(scene, ar, ob, 1, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth);
+ retval |= snapObject(scene, ar, ob, 1, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
}
/* Need an exception for particle edit because the base is flagged with BA_HAS_RECALC_DATA
@@ -1607,7 +1618,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, f
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, loc, no, dist, &depth);
+ retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
}
for ( base = FIRSTBASE; base != NULL; base = base->next ) {
@@ -1623,30 +1634,30 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, f
{
Object *dob = dupli_ob->ob;
- retval |= snapObject(scene, ar, dob, 0, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth);
+ retval |= snapObject(scene, ar, dob, 0, dupli_ob->mat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
}
free_object_duplilist(lb);
}
- retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth);
+ retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
}
}
return retval;
}
-int snapObjectsTransform(TransInfo *t, float mval[2], int *dist, float *loc, float *no, SnapMode mode)
+int snapObjectsTransform(TransInfo *t, const float mval[2], int *r_dist, float r_loc[3], float r_no[3], SnapMode mode)
{
- return snapObjects(t->scene, t->view, t->ar, t->obedit, mval, dist, loc, no, mode);
+ return snapObjects(t->scene, t->view, t->ar, t->obedit, mval, r_dist, r_loc, r_no, mode);
}
-int snapObjectsContext(bContext *C, float mval[2], int *dist, float *loc, float *no, SnapMode mode)
+int snapObjectsContext(bContext *C, const float mval[2], int *r_dist, float r_loc[3], float r_no[3], SnapMode mode)
{
ScrArea *sa = CTX_wm_area(C);
View3D *v3d = sa->spacedata.first;
- return snapObjects(CTX_data_scene(C), v3d, CTX_wm_region(C), CTX_data_edit_object(C), mval, dist, loc, no, mode);
+ return snapObjects(CTX_data_scene(C), v3d, CTX_wm_region(C), CTX_data_edit_object(C), mval, r_dist, r_loc, r_no, mode);
}
/******************** PEELING *********************************/
@@ -1706,7 +1717,9 @@ static void addDepthPeel(ListBase *depth_peels, float depth, float p[3], float n
peel->flag = 0;
}
-static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], float UNUSED(mval[2]), ListBase *depth_peels)
+static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
+ const float ray_start[3], const float ray_normal[3], const float UNUSED(mval[2]),
+ ListBase *depth_peels)
{
int retval = 0;
int totvert = dm->getNumVerts(dm);
@@ -1814,7 +1827,7 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float
return retval;
}
-static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase *depth_peels, float mval[2])
+static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase *depth_peels, const float mval[2])
{
Base *base;
int retval = 0;
@@ -1895,12 +1908,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
return retval;
}
-int peelObjectsTransForm(TransInfo *t, ListBase *depth_peels, float mval[2])
+int peelObjectsTransForm(TransInfo *t, ListBase *depth_peels, const float mval[2])
{
return peelObjects(t->scene, t->view, t->ar, t->obedit, depth_peels, mval);
}
-int peelObjectsContext(bContext *C, ListBase *depth_peels, float mval[2])
+int peelObjectsContext(bContext *C, ListBase *depth_peels, const float mval[2])
{
ScrArea *sa = CTX_wm_area(C);
View3D *v3d = sa->spacedata.first;
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 173ab809b53..7fc878de3f9 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -1490,7 +1490,7 @@ static void UV_OT_stitch(wmOperatorType *ot)
/* ******************** (de)select all operator **************** */
-static int select_all_exec(bContext *C, wmOperator *op)
+static void select_all_perform(bContext *C, int action)
{
Scene *scene;
ToolSettings *ts;
@@ -1499,7 +1499,6 @@ static int select_all_exec(bContext *C, wmOperator *op)
EditFace *efa;
Image *ima;
MTFace *tf;
- int action = RNA_enum_get(op->ptr, "action");
scene= CTX_data_scene(C);
ts= CTX_data_tool_settings(C);
@@ -1560,6 +1559,15 @@ static int select_all_exec(bContext *C, wmOperator *op)
}
}
}
+}
+
+static int select_all_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit= CTX_data_edit_object(C);
+ EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
+ int action= RNA_enum_get(op->ptr, "action");
+
+ select_all_perform(C, action);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@@ -2275,7 +2283,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
MTFace *tface;
rcti rect;
rctf rectf;
- int change, pinned, select, faces;
+ int change, pinned, select, faces, extend;
/* get rectangle from operator */
rect.xmin= RNA_int_get(op->ptr, "xmin");
@@ -2289,6 +2297,10 @@ static int border_select_exec(bContext *C, wmOperator *op)
/* figure out what to select/deselect */
select= (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
pinned= RNA_boolean_get(op->ptr, "pinned");
+ extend= RNA_boolean_get(op->ptr, "extend");
+
+ if(!extend)
+ select_all_perform(C, SEL_DESELECT);
if(ts->uv_flag & UV_SYNC_SELECTION)
faces= (ts->selectmode == SCE_SELECT_FACE);
@@ -2411,7 +2423,7 @@ static void UV_OT_select_border(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only");
- WM_operator_properties_gesture_border(ot, FALSE);
+ WM_operator_properties_gesture_border(ot, TRUE);
}
/* ******************** circle select operator **************** */
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 1b117a15516..7ad573231c9 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -546,17 +546,21 @@ static void p_face_flip(PFace *f)
PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
int f1 = e1->flag, f2 = e2->flag, f3 = e3->flag;
+ float *orig_uv1 = e1->orig_uv, *orig_uv2 = e2->orig_uv, *orig_uv3 = e3->orig_uv;
e1->vert = v2;
e1->next = e3;
+ e1->orig_uv = orig_uv2;
e1->flag = (f1 & ~PEDGE_VERTEX_FLAGS) | (f2 & PEDGE_VERTEX_FLAGS);
e2->vert = v3;
e2->next = e1;
+ e2->orig_uv = orig_uv3;
e2->flag = (f2 & ~PEDGE_VERTEX_FLAGS) | (f3 & PEDGE_VERTEX_FLAGS);
e3->vert = v1;
e3->next = e2;
+ e3->orig_uv = orig_uv1;
e3->flag = (f3 & ~PEDGE_VERTEX_FLAGS) | (f1 & PEDGE_VERTEX_FLAGS);
}
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 557b22e3a2e..4488442815d 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -31,6 +31,8 @@ set(INC
../imbuf
../makesdna
../makesrna
+ ../nodes # For node muting stuff...
+ ../nodes/intern # For node muting stuff...
../../../intern/guardedalloc
../../../intern/smoke/extern
)
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 00c47a2501f..e838d801dc1 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -49,6 +49,7 @@ struct Lamp;
struct Image;
struct bNode;
struct LinkNode;
+struct LinkInOutsMuteNode;
struct Scene;
struct GPUVertexAttribs;
struct GPUNode;
@@ -117,6 +118,7 @@ GPUNodeLink *GPU_builtin(GPUBuiltin builtin);
int GPU_link(GPUMaterial *mat, const char *name, ...);
int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...);
+int GPU_stack_link_mute(GPUMaterial *mat, const char *name, struct LinkInOutsMuteNode *mlnk);
void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link);
void GPU_material_enable_alpha(GPUMaterial *material);
diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript
index adb52d577a1..ee4491c1c77 100644
--- a/source/blender/gpu/SConscript
+++ b/source/blender/gpu/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('intern/*.c')
defs = [ 'GLEW_STATIC' ]
-incs = '../blenlib ../blenkernel ../makesdna ../makesrna ../include ../blenloader'
+incs = '../blenlib ../blenkernel ../makesdna ../makesrna ../include ../blenloader ../nodes ../nodes/intern'
incs += ' #/extern/glew/include #intern/guardedalloc #intern/smoke/extern ../imbuf .'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 35ef48250cc..4a923e66356 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -54,6 +54,8 @@
#include "gpu_codegen.h"
+#include "node_util.h" /* For muting node stuff... */
+
#include <string.h>
#include <stdarg.h>
@@ -1212,6 +1214,31 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode
return 1;
}
+int GPU_stack_link_mute(GPUMaterial *mat, const char *name, LinkInOutsMuteNode *mlnk)
+{
+ GPUNode *node;
+ GPUFunction *function;
+ int i;
+
+ function = GPU_lookup_function(name);
+ if(!function) {
+ fprintf(stderr, "GPU failed to find function %s\n", name);
+ return 0;
+ }
+
+ for(i = 0; i < mlnk->num_outs; i++) {
+ node = GPU_node_begin(name);
+ gpu_node_input_socket(node, (GPUNodeStack*)mlnk->in);
+ GPU_node_output(node, ((GPUNodeStack*)mlnk->outs+i)->type, ((GPUNodeStack*)mlnk->outs+i)->name,
+ &((GPUNodeStack*)mlnk->outs+i)->link);
+ GPU_node_end(node);
+
+ gpu_material_add_node(mat, node);
+ }
+
+ return 1;
+}
+
int GPU_link_changed(GPUNodeLink *link)
{
GPUNode *node;
diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl b/source/blender/gpu/intern/gpu_shader_material.glsl
index 4a9d793aaad..5d2da31ac5f 100644
--- a/source/blender/gpu/intern/gpu_shader_material.glsl
+++ b/source/blender/gpu/intern/gpu_shader_material.glsl
@@ -122,7 +122,7 @@ void uv_attribute(vec2 attuv, out vec3 uv)
uv = vec3(attuv*2.0 - vec2(1.0, 1.0), 0.0);
}
-void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 attvcol, out vec3 global, out vec3 local, out vec3 view, out vec3 orco, out vec3 uv, out vec3 normal, out vec4 vcol, out float frontback)
+void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 attvcol, out vec3 global, out vec3 local, out vec3 view, out vec3 orco, out vec3 uv, out vec3 normal, out vec4 vcol, out float vcol_alpha, out float frontback)
{
local = co;
view = normalize(local);
@@ -131,6 +131,7 @@ void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 att
uv_attribute(attuv, uv);
normal = -normalize(nor); /* blender render normal is negated */
vcol_attribute(attvcol, vcol);
+ vcol_alpha = attvcol.a;
frontback = 1.0;
}
@@ -367,6 +368,26 @@ void set_rgba_zero(out vec4 outval)
outval = vec4(0.0);
}
+void copy_raw(vec4 val, out vec4 outval)
+{
+ outval = val;
+}
+
+void copy_raw(vec3 val, out vec3 outval)
+{
+ outval = val;
+}
+
+void copy_raw(vec2 val, out vec2 outval)
+{
+ outval = val;
+}
+
+void copy_raw(float val, out float outval)
+{
+ outval = val;
+}
+
void mix_blend(float fac, vec4 col1, vec4 col2, out vec4 outcol)
{
fac = clamp(fac, 0.0, 1.0);
@@ -1836,7 +1857,7 @@ float hypot(float x, float y)
/* bsdfs */
-void node_bsdf_diffuse(vec4 color, vec3 N, out vec4 result)
+void node_bsdf_diffuse(vec4 color, float roughness, vec3 N, out vec4 result)
{
/* ambient light */
vec3 L = vec3(0.2);
@@ -1855,14 +1876,19 @@ void node_bsdf_diffuse(vec4 color, vec3 N, out vec4 result)
void node_bsdf_glossy(vec4 color, float roughness, vec3 N, vec3 I, out vec4 result)
{
- vec3 L = vec3(0.0);
+ /* ambient light */
+ vec3 L = vec3(0.2);
/* directional lights */
for(int i = 0; i < NUM_LIGHTS; i++) {
+ vec3 light_position = gl_LightSource[i].position.xyz;
vec3 H = gl_LightSource[i].halfVector.xyz;
+ vec3 light_diffuse = gl_LightSource[i].diffuse.rgb;
vec3 light_specular = gl_LightSource[i].specular.rgb;
- float bsdf = pow(max(dot(N, H), 0.0), 1.0/roughness);
+ /* we mix in some diffuse so low roughness still shows up */
+ float bsdf = 0.5*pow(max(dot(N, H), 0.0), 1.0/roughness);
+ bsdf += 0.5*max(dot(N, light_position), 0.0);
L += light_specular*bsdf;
}
@@ -1871,17 +1897,17 @@ void node_bsdf_glossy(vec4 color, float roughness, vec3 N, vec3 I, out vec4 resu
void node_bsdf_anisotropic(vec4 color, float roughnessU, float roughnessV, vec3 N, vec3 I, out vec4 result)
{
- node_bsdf_diffuse(color, N, result);
+ node_bsdf_diffuse(color, 0.0, N, result);
}
void node_bsdf_glass(vec4 color, float roughness, float ior, vec3 N, vec3 I, out vec4 result)
{
- node_bsdf_diffuse(color, N, result);
+ node_bsdf_diffuse(color, 0.0, N, result);
}
void node_bsdf_translucent(vec4 color, vec3 N, out vec4 result)
{
- node_bsdf_diffuse(color, N, result);
+ node_bsdf_diffuse(color, 0.0, N, result);
}
void node_bsdf_transparent(vec4 color, out vec4 result)
@@ -1895,7 +1921,7 @@ void node_bsdf_transparent(vec4 color, out vec4 result)
void node_bsdf_velvet(vec4 color, float sigma, vec3 N, out vec4 result)
{
- node_bsdf_diffuse(color, N, result);
+ node_bsdf_diffuse(color, 0.0, N, result);
}
/* emission */
diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl.c b/source/blender/gpu/intern/gpu_shader_material.glsl.c
index e284c42532b..0b7bd5d48bf 100644
--- a/source/blender/gpu/intern/gpu_shader_material.glsl.c
+++ b/source/blender/gpu/intern/gpu_shader_material.glsl.c
@@ -1,6 +1,6 @@
/* DataToC output of file <gpu_shader_material_glsl> */
-int datatoc_gpu_shader_material_glsl_size= 46289;
+int datatoc_gpu_shader_material_glsl_size= 46865;
char datatoc_gpu_shader_material_glsl[]= {
10,102,108,111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101,
114, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10, 9,114,101,116,117,114,110, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56,
@@ -79,1246 +79,1264 @@ char datatoc_gpu_shader_material_glsl[]= {
116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51,
32,108,111, 99, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109,
- 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102,114,111,
-110,116, 98, 97, 99,107, 41, 10,123, 10, 9,108,111, 99, 97,108, 32, 61, 32, 99,111, 59, 10, 9,118,105,101,119, 32, 61, 32,110,
-111,114,109, 97,108,105,122,101, 40,108,111, 99, 97,108, 41, 59, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,
-105,110,118,109, 97,116, 42,118,101, 99, 52, 40,108,111, 99, 97,108, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,111,
-114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10, 9,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,
-117,118, 44, 32,117,118, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,110,111,
-114, 41, 59, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,
-110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,118, 99,
-111,108, 44, 32,118, 99,111,108, 41, 59, 10, 9,102,114,111,110,116, 98, 97, 99,107, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,
-118,111,105,100, 32,109, 97,112,112,105,110,103, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,109, 97,116, 52, 32,109, 97,116, 44,
- 32,118,101, 99, 51, 32,109,105,110,118,101, 99, 44, 32,118,101, 99, 51, 32,109, 97,120,118,101, 99, 44, 32,102,108,111, 97,116,
- 32,100,111,109,105,110, 44, 32,102,108,111, 97,116, 32,100,111,109, 97,120, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,
-116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 40,109, 97,116, 32, 42, 32,118,101, 99, 52, 40,118,101,
- 99, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,105,102, 40,100,111,109,105,110, 32, 61, 61, 32, 49, 46, 48, 41, 10,
- 9, 9,111,117,116,118,101, 99, 32, 61, 32,109, 97,120, 40,111,117,116,118,101, 99, 44, 32,109,105,110,118,101, 99, 41, 59, 10,
- 9,105,102, 40,100,111,109, 97,120, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109,105,110,
- 40,111,117,116,118,101, 99, 44, 32,109, 97,120,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99, 97,109,101,114, 97,
- 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,105,101,119, 44, 32,111,117,116, 32,
-102,108,111, 97,116, 32,111,117,116,100,101,112,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,105,115,
-116, 41, 10,123, 10, 9,111,117,116,100,101,112,116,104, 32, 61, 32, 97, 98,115, 40, 99,111, 46,122, 41, 59, 10, 9,111,117,116,
-100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40, 99,111, 41, 59, 10, 9,111,117,116,118,105,101,119, 32, 61, 32,110,111,
-114,109, 97,108,105,122,101, 40, 99,111, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,100,100, 40,102,108,
-111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
-111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 43, 32,118, 97,108, 50, 59,
- 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,117, 98,116,114, 97, 99,116, 40,102,108,111, 97,116, 32,118, 97,108,
- 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41,
- 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 45, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,
-100, 32,109, 97,116,104, 95,109,117,108,116,105,112,108,121, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,
-116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,
-118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 42, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,
-100,105,118,105,100,101, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,
-117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 50, 32, 61, 61, 32,
- 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,
-118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 47, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,
-115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
- 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,115,105,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
-109, 97,116,104, 95, 99,111,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116,
- 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,115, 40,118, 97,108, 41, 59, 10,125,
- 10, 10,118,111,105,100, 32,109, 97,116,104, 95,116, 97,110,103,101,110,116, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,
-117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,116, 97,110,
- 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,115,105,110, 40,102,108,111, 97,116, 32,118,
- 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108,
- 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108,
- 32, 61, 32, 97,115,105,110, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48,
- 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97, 99,111,115, 40,102,108,111, 97,116, 32,118, 97,108, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61,
- 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,
- 97, 99,111,115, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59,
- 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,116, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,
-116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 97,116, 97,110,
- 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,112,111,119, 40,102,108,111, 97,116, 32,118, 97,
-108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
- 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 49, 32, 62, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61,
- 32,112,111,119, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108,
- 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,111,103, 40,102,108,111, 97,116, 32,118,
- 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,
-108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32, 48, 46, 48, 32, 32, 38, 38, 32,118, 97,108, 50, 32, 62, 32, 48,
- 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 61, 32,108,111,103, 50, 40,118, 97,108, 49, 41, 32, 47, 32,108,111,103, 50, 40,
-118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,
-111,105,100, 32,109, 97,116,104, 95,109, 97,120, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118,
+ 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 99,111,
+108, 95, 97,108,112,104, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102,114,111,110,116, 98, 97, 99,107, 41, 10,123, 10,
+ 9,108,111, 99, 97,108, 32, 61, 32, 99,111, 59, 10, 9,118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,
+111, 99, 97,108, 41, 59, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99,
+ 52, 40,108,111, 99, 97,108, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,
+114, 99,111, 59, 10, 9,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,117,118, 44, 32,117,118, 41, 59, 10, 9,
+110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,110,111,114, 41, 59, 9, 47, 42, 32, 98,108,101,
+110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47,
+ 10, 9,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,118, 99,111,108, 44, 32,118, 99,111,108, 41, 59,
+ 10, 9,118, 99,111,108, 95, 97,108,112,104, 97, 32, 61, 32, 97,116,116,118, 99,111,108, 46, 97, 59, 10, 9,102,114,111,110,116,
+ 98, 97, 99,107, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,112,112,105,110,103, 40,118,101, 99, 51,
+ 32,118,101, 99, 44, 32,109, 97,116, 52, 32,109, 97,116, 44, 32,118,101, 99, 51, 32,109,105,110,118,101, 99, 44, 32,118,101, 99,
+ 51, 32,109, 97,120,118,101, 99, 44, 32,102,108,111, 97,116, 32,100,111,109,105,110, 44, 32,102,108,111, 97,116, 32,100,111,109,
+ 97,120, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61,
+ 32, 40,109, 97,116, 32, 42, 32,118,101, 99, 52, 40,118,101, 99, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,105,102,
+ 40,100,111,109,105,110, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109, 97,120, 40,111,117,
+116,118,101, 99, 44, 32,109,105,110,118,101, 99, 41, 59, 10, 9,105,102, 40,100,111,109, 97,120, 32, 61, 61, 32, 49, 46, 48, 41,
+ 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109,105,110, 40,111,117,116,118,101, 99, 44, 32,109, 97,120,118,101, 99, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32, 99, 97,109,101,114, 97, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,111,117,116,118,105,101,119, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,101,112,116,104, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,100,105,115,116, 41, 10,123, 10, 9,111,117,116,100,101,112,116,104, 32, 61, 32,
+ 97, 98,115, 40, 99,111, 46,122, 41, 59, 10, 9,111,117,116,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40, 99,111, 41,
+ 59, 10, 9,111,117,116,118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32,109, 97,116,104, 95, 97,100,100, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118,
97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108,
- 32, 61, 32,109, 97,120, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104,
- 95,109,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116,
- 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109,105,110, 40,118,
- 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,114,111,117,110,100, 40,102,
-108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,
-117,116,118, 97,108, 61, 32,102,108,111,111,114, 40,118, 97,108, 32, 43, 32, 48, 46, 53, 41, 59, 10,125, 10, 10,118,111,105,100,
- 32,109, 97,116,104, 95,108,101,115,115, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,
-116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,
-118, 97,108, 49, 32, 60, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,
-115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,
-103,114,101, 97,116,101,114, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118,
- 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108,
- 49, 32, 62, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10,
- 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,113,117,101,101,122,101, 40,
-102,108,111, 97,116, 32,118, 97,108, 44, 32,102,108,111, 97,116, 32,119,105,100,116,104, 44, 32,102,108,111, 97,116, 32, 99,101,
-110,116,101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,
-108, 32, 61, 32, 49, 46, 48, 47, 40, 49, 46, 48, 32, 43, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 51, 44, 32, 45,
- 40, 40,118, 97,108, 45, 99,101,110,116,101,114, 41, 42,119,105,100,116,104, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
-118,101, 99, 95,109, 97,116,104, 95, 97,100,100, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,
-117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
- 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61,
- 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93,
- 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100,
- 32,118,101, 99, 95,109, 97,116,104, 95,115,117, 98, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,
-111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,
-108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 45, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32,
- 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49,
- 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,
-100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,118,101,114, 97,103,101, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51,
- 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
-111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,
-116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61,
- 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,
-109, 97,116,104, 95,100,111,116, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,
-101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10,
- 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 44, 32, 48, 44, 32, 48, 41, 59, 10, 9,111,117,116,118, 97,108,
- 32, 61, 32,100,111,116, 40,118, 49, 44, 32,118, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104,
- 95, 99,114,111,115,115, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99,
- 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,
-117,116,118,101, 99, 32, 61, 32, 99,114,111,115,115, 40,118, 49, 44, 32,118, 50, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61,
- 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,
-104, 95,110,111,114,109, 97,108,105,122,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,
-118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108,
- 32, 61, 32,108,101,110,103,116,104, 40,118, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,
-101, 40,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,101,103, 97,116,101, 40,118,101,
- 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 41, 10,123, 10, 9,111,117,116,118, 32, 61, 32, 45,
-118, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,100,105,114, 44, 32,118,101, 99, 51,
- 32,110,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116,
- 32,111,117,116,100,111,116, 41, 10,123, 10, 9,111,117,116,110,111,114, 32, 61, 32,100,105,114, 59, 10, 9,111,117,116,100,111,
-116, 32, 61, 32, 45,100,111,116, 40,100,105,114, 44, 32,110,111,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,
-101,115, 95,118,101, 99, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,
-108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41,
- 10,123, 10, 9,111,117,116,118,101, 99, 46,120, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,
-112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,120, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41,
- 46,120, 59, 10, 9,111,117,116,118,101, 99, 46,121, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109,
- 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,121, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41,
- 41, 46,121, 59, 10, 9,111,117,116,118,101, 99, 46,122, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,
-109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,122, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48,
- 41, 41, 46,122, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99,
- 32, 61, 32, 40,111,117,116,118,101, 99, 42,102, 97, 99, 41, 32, 43, 32, 40,118,101, 99, 42, 40, 49, 46, 48, 45,102, 97, 99, 41,
- 41, 59, 10, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99,
- 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,
-111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,
-101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50,
- 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46,114, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44,
- 32, 48, 46, 48, 41, 41, 46,114, 59, 10, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,
- 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,
-112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46,103, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,103, 59,
- 10, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44,
- 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,
-111,108, 46, 98, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46, 98, 59, 10, 10, 9,105,102, 32, 40,102, 97,
- 99, 32, 33, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32, 40,111,117,116, 99,111,108, 42,102, 97, 99,
- 41, 32, 43, 32, 40, 99,111,108, 42, 40, 49, 46, 48, 45,102, 97, 99, 41, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 46, 97, 32,
- 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 40,102,108,111, 97,116,
+ 32, 61, 32,118, 97,108, 49, 32, 43, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,117, 98,
+116,114, 97, 99,116, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49,
+ 32, 45, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,117,108,116,105,112,108,121, 40,102,
+108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 42, 32,118, 97,108, 50,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,100,105,118,105,100,101, 40,102,108,111, 97,116, 32,118, 97,108, 49,
+ 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,
+123, 10, 9,105,102, 32, 40,118, 97,108, 50, 32, 61, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48,
+ 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 47, 32,118, 97,108, 50,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,115,105,110,
+ 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 99,111,115,105,110,101, 40,102,108,111, 97,116,
32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,
-108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 40,118,101, 99, 51, 32, 99,111,
-108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,
- 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,
-111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108,
- 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 95,122,101,114,111, 40,111,117,116, 32,102,108,111,
- 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,
-111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 95,111,110,101, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,
- 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116,
- 95,114,103, 98, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,
-116,118, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103,
- 98, 97, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,
- 97,108, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,108,101,110,
-100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108,
- 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,
-109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120,
- 40, 99,111,108, 49, 44, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,
-111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 97,100,100, 40,102,108,111, 97,116, 32,102, 97, 99,
- 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52,
- 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48,
- 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49,
- 32, 43, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46,
- 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,109,117,108,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,
-101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,
-116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49,
- 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 42, 32,
- 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,
-125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101,
+108, 32, 61, 32, 99,111,115, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,116, 97,110,103,101,
+110,116, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,
+123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,
+116,104, 95, 97,115,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,
+118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61,
+ 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97,115,105,110, 40,118, 97,108, 41, 59, 10, 9,101,108,
+115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,
+ 97, 99,111,115, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
+ 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49,
+ 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97, 99,111,115, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10,
+ 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,116, 97,
+110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123,
+ 10, 9,111,117,116,118, 97,108, 32, 61, 32, 97,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,
+116,104, 95,112,111,119, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 49, 32, 62, 61, 32,
+ 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,112,111,119, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59,
+ 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,
+ 97,116,104, 95,108,111,103, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32, 48,
+ 46, 48, 32, 32, 38, 38, 32,118, 97,108, 50, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 61, 32,108,111,103,
+ 50, 40,118, 97,108, 49, 41, 32, 47, 32,108,111,103, 50, 40,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,
+116,118, 97,108, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109, 97,120, 40,102,108,111, 97,
+116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,
+116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40,118, 97,108, 49, 44, 32,118, 97,108, 50,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,
+102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10,
+ 9,111,117,116,118, 97,108, 32, 61, 32,109,105,110, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,
+105,100, 32,109, 97,116,104, 95,114,111,117,110,100, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 61, 32,102,108,111,111,114, 40,118, 97,108, 32,
+ 43, 32, 48, 46, 53, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,101,115,115, 95,116,104, 97,110, 40,102,
+108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 60, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,
+116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,103,114,101, 97,116,101,114, 95,116,104, 97,110, 40,102,108,111, 97,
+116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,
+116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,
+108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125,
+ 10, 10,118,111,105,100, 32,115,113,117,101,101,122,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,102,108,111, 97,116, 32,
+119,105,100,116,104, 44, 32,102,108,111, 97,116, 32, 99,101,110,116,101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,
+117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 47, 40, 49, 46, 48, 32, 43, 32,112,111,
+119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 51, 44, 32, 45, 40, 40,118, 97,108, 45, 99,101,110,116,101,114, 41, 42,119,105,100,
+116,104, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,100,100, 40,118,101, 99, 51,
+ 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32,
+ 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32,
+ 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93,
+ 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,115,117, 98, 40,118,101, 99,
+ 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49,
+ 32, 45, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41,
+ 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50,
+ 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,118,101,114, 97,103,
+101, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,
+118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99,
+ 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,
+118,101, 99, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,118,101, 99,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,100,111,116, 40,118,101, 99, 51, 32,118, 49, 44,
+ 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,
+108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 44,
+ 32, 48, 44, 32, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,100,111,116, 40,118, 49, 44, 32,118, 50, 41, 59, 10,125,
+ 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 99,114,111,115,115, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,
+101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 99,114,111,115,115, 40,118, 49, 44,
+ 32,118, 50, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10,
+125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,111,114,109, 97,108,105,122,101, 40,118,101, 99, 51, 32,
+118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,
+116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,118, 41, 59, 10, 9,111,117,
+116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99,
+ 95,109, 97,116,104, 95,110,101,103, 97,116,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,
+116,118, 41, 10,123, 10, 9,111,117,116,118, 32, 61, 32, 45,118, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,114,109, 97,108,
+ 40,118,101, 99, 51, 32,100,105,114, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,
+116,110,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,111,116, 41, 10,123, 10, 9,111,117,116,110,111,
+114, 32, 61, 32,100,105,114, 59, 10, 9,111,117,116,100,111,116, 32, 61, 32, 45,100,111,116, 40,100,105,114, 44, 32,110,111,114,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,118,101, 99, 40,102,108,111, 97,116, 32,102, 97, 99, 44,
+ 32,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,
+117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 46,120, 32, 61, 32,116,101,
+120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,120, 32, 43, 32,
+ 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10, 9,111,117,116,118,101, 99, 46,121, 32, 61, 32,116,
+101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,121, 32, 43,
+ 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,121, 59, 10, 9,111,117,116,118,101, 99, 46,122, 32, 61, 32,
+116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,122, 32,
+ 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,122, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33,
+ 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32, 40,111,117,116,118,101, 99, 42,102, 97, 99, 41, 32, 43,
+ 32, 40,118,101, 99, 42, 40, 49, 46, 48, 45,102, 97, 99, 41, 41, 59, 10, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,
+115, 95,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,115, 97,109,112,108,
+101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,
+123, 10, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112,
+ 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,
+ 99,111,108, 46,114, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,114, 59, 10, 9,111,117,116, 99,111,108,
+ 46,103, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,
+120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46,103, 44, 32, 48, 46,
+ 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,103, 59, 10, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,101,120,116,
+117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,
+117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46, 98, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46,
+ 48, 41, 41, 46, 98, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,
+108, 32, 61, 32, 40,111,117,116, 99,111,108, 42,102, 97, 99, 41, 32, 43, 32, 40, 99,111,108, 42, 40, 49, 46, 48, 45,102, 97, 99,
+ 41, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,101,116, 95,118, 97,108,117,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,
+117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,101,116, 95,114,103, 98, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,
+114,103, 98, 97, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,
+123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,
+117,101, 95,122,101,114,111, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,
+118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 95,111,110,101,
+ 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49,
+ 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99,
+ 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99, 52, 32,
+111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 48, 41, 59, 10,125,
+ 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 52, 32,118, 97,108, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,
+111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 51, 32,118, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
+111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100,
+ 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 50, 32,118, 97,108, 44, 32,111,117,116, 32,118,101, 99, 50, 32,111,117,116,
+118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,
+112,121, 95,114, 97,119, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,
+ 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120,
+ 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99,
+ 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32,
+ 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46,
+ 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 97,100,100, 40,102,108,111, 97,
+116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116,
+ 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99,
+ 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44,
+ 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32,
+ 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,109,117,108,116, 40,102,108,111, 97,116, 32,102,
+ 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48,
+ 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,
+108, 49, 32, 42, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108,
+ 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,102, 97,
+ 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99,
+ 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46,
+ 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,
+ 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 52, 40,102,
+ 97, 99,109, 41, 32, 43, 32,102, 97, 99, 42, 40,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 50, 41, 41, 42, 40,
+118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,
+111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,111,118,101,114,108, 97,121, 40,102,108,111, 97,116,
+ 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,
+118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44,
+ 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,
+102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,
+108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32,
+ 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114,
+ 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32,
+ 99,111,108, 50, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,
+111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 42, 61, 32,102, 97,
+ 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,
+ 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49,
+ 46, 48, 32, 45, 32, 99,111,108, 50, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10,
+ 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32,
+ 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,101,108,115,101, 10,
+ 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102,
+ 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46, 98, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108,
+ 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,117, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,
+118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,
+117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32,
+ 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 45,
+ 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,118, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52,
+ 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41,
+ 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116,
+ 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,
+111,117,116, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99, 42,111,
+117,116, 99,111,108, 46,114, 47, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 50, 46,103, 32, 33, 61, 32, 48, 46,
+ 48, 41, 32,111,117,116, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97,
+ 99, 42,111,117,116, 99,111,108, 46,103, 47, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 33, 61,
+ 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43,
+ 32,102, 97, 99, 42,111,117,116, 99,111,108, 46, 98, 47, 99,111,108, 50, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,
+120, 95,100,105,102,102, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99,
+ 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32,
+ 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 97, 98,115, 40, 99,111,108, 49, 32, 45, 32, 99,111,108, 50, 41, 44, 32,102, 97,
+ 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,
+109,105,120, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97,
+ 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,
+108, 46,114,103, 98, 32, 61, 32,109,105,110, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102,
+ 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100,
+ 32,109,105,120, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44,
+ 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,
+102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116,
+ 99,111,108, 46,114,103, 98, 32, 61, 32,109, 97,120, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98,
+ 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,
+105,100, 32,109,105,120, 95,100,111,100,103,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108,
+ 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123,
+ 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,
+117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 33, 61, 32, 48,
+ 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,
+108, 50, 46,114, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108,
+ 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,
+108, 46,114, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46,
+ 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,
+ 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,
+109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9, 9,105,102, 40,116,109,112, 32,
+ 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,
+101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,103, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41,
+ 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,
+116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 33, 61,
+ 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42,
+ 99,111,108, 50, 46, 98, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,
+111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116,
+ 99,111,108, 46, 98, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,
+ 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10, 9,
+125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,117,114,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101,
99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,
99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46,
- 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,
-117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 52, 40,102, 97, 99,109, 41, 32,
- 43, 32,102, 97, 99, 42, 40,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 50, 41, 41, 42, 40,118,101, 99, 52, 40,
- 49, 46, 48, 41, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97,
- 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,111,118,101,114,108, 97,121, 40,102,108,111, 97,116, 32,102, 97, 99, 44,
- 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
-111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44,
- 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10,
- 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 60,
- 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102,
- 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46,
- 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46,
-114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,
-108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32,
- 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103,
- 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32,
- 99,111,108, 50, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,
-111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 42, 61, 32,102, 97,
- 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,
- 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49,
- 46, 48, 32, 45, 32, 99,111,108, 50, 46, 98, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,
-125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,117, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32,
- 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108,
- 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59,
- 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 45, 32, 99,111,108, 50,
- 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,
-111,105,100, 32,109,105,120, 95,100,105,118, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49,
- 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10,
- 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,
-111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61,
- 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,
-108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108,
- 46,114, 47, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 50, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,
-116, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99, 42,111,117,116,
- 99,111,108, 46,103, 47, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41,
- 32,111,117,116, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99, 42,
-111,117,116, 99,111,108, 46, 98, 47, 99,111,108, 50, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,102,
-102, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108,
- 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,
-109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120,
- 40, 99,111,108, 49, 44, 32, 97, 98,115, 40, 99,111,108, 49, 32, 45, 32, 99,111,108, 50, 41, 44, 32,102, 97, 99, 41, 59, 10, 9,
-111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,
- 97,114,107, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,
-111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,
-108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,103, 98,
- 32, 61, 32,109,105,110, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41, 59, 10,
- 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,
-108,105,103,104,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52,
- 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61,
- 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,
-103, 98, 32, 61, 32,109, 97,120, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41,
- 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,
-120, 95,100,111,100,103,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101,
- 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99,
- 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108,
- 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,123,
- 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59,
- 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,
- 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,114, 47,116,
-109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,
-101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,
-117,116, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32,
- 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46,
- 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40,
- 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,103, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,
-117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,
-103, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41,
- 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,
- 98, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32,
- 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46, 98,
- 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10,
- 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,
-118,111,105,100, 32,109,105,120, 95, 98,117,114,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,
-108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,
-123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,
-102,108,111, 97,116, 32,116,109,112, 44, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,
-117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99,
- 42, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,
-108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32,
- 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10,
- 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62,
- 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,
-111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102,
- 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,
- 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46,
- 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48,
- 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112,
- 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10,
- 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43,
- 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,
-117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40,
- 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48,
- 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,
-109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,
-101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,
-104,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,
-111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,
-108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109,
- 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10,
- 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,
-118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46,
- 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10,
- 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,
-115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,
-108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46,
- 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 97,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44,
- 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
-111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44,
- 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10,
- 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118,
- 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,105,
-102, 40,104,115,118, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,
-111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,
-121, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118,
- 44, 32,111,117,116, 99,111,108, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,118, 97,108, 40,102,108,
-111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,
-117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102,
- 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48,
- 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,
-111, 95,104,115,118, 40, 99,111,108, 49, 44, 32,104,115,118, 41, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,
-108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,104,115,118, 46,122, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,122, 32,
- 43, 32,102, 97, 99, 42,104,115,118, 50, 46,122, 59, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,
-117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 99,111,108,111,114, 40,102,108,111, 97,116, 32,
-102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,
-101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32,
- 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102,
- 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44,
- 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,
-118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98,
- 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,
-104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,
-116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,
-105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97,
- 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,111,102,116, 40,102,
+ 48, 41, 59, 10, 9,102,108,111, 97,116, 32,116,109,112, 44, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,
+ 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32,
+ 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,
+111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,
+ 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 47,116,109,112, 41, 41, 32, 60, 32,
+ 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,
+116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,
+115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,
+109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10,
+ 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32,
+ 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 47,116,109,112, 41, 41, 32,
+ 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,
+102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9,
+101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102,
+ 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48,
+ 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,
+112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 47,116,109,112, 41,
+ 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101,
+ 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59,
+ 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10,125, 10, 10,118,111,105,100,
+ 32,109,105,120, 95,104,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97,
+ 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116,
+ 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,
+108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,
+116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32,
+ 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,
+115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 95,116,111, 95,
+114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40,
+111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32,
+ 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 97,116, 40,102,108,111, 97,116,
+ 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,
+118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44,
+ 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,
+102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118,
+ 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41,
+ 59, 10, 10, 9,105,102, 40,104,115,118, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,
+104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,102, 97, 99,109,
+ 42,104,115,118, 46,121, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103,
+ 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,118,
+ 97,108, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,
+108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108,
+ 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32,
+ 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,
+114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 49, 44, 32,104,115,118, 41, 59, 10, 9,114,103, 98, 95,116,111, 95,104,
+115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,104,115,118, 46,122, 32, 61, 32,102, 97, 99,109, 42,104,
+115,118, 46,122, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,122, 59, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,
+115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 99,111,108,111,114, 40,102,
108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,
111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,
102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46,
- 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,111,110,101, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10,
- 9,118,101, 99, 52, 32,115, 99,114, 61, 32,111,110,101, 32, 45, 32, 40,111,110,101, 32, 45, 32, 99,111,108, 50, 41, 42, 40,111,
-110,101, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,102, 97, 99,109, 42, 99,111,108, 49, 32,
- 43, 32,102, 97, 99, 42, 40, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 42, 99,111,108, 50, 42, 99,111,108, 49, 32, 43, 32,
- 99,111,108, 49, 42,115, 99,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,108,105,110,101, 97,114, 40,102,108,
-111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,
-117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102,
- 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10,
- 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 61, 32, 99,
-111,108, 49, 46,114, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 32, 45, 32, 48, 46, 53, 41, 41,
- 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 61, 32, 99,111,108, 49, 46,114, 32, 43, 32,102, 97, 99,
- 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, 40, 99,111,108, 50,
- 46,103, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,103, 32, 43, 32,102,
- 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,103, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9,
- 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,
-108, 50, 46,103, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 62, 32, 48, 46, 53, 41,
- 10, 9, 9,111,117,116, 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40,
- 99,111,108, 50, 46, 98, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98,
- 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, 41, 32, 45, 32, 49,
- 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118, 97,108,116,111,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44,
- 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,111,108,111,114,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,
-116, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, 97,108,112,104, 97, 41, 10,123, 10, 9,111,117,116,
- 99,111,108, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,111,108,111,114,109, 97,112, 44, 32,118,101, 99, 50, 40,102,
- 97, 99, 44, 32, 48, 46, 48, 41, 41, 59, 10, 9,111,117,116, 97,108,112,104, 97, 32, 61, 32,111,117,116, 99,111,108, 46, 97, 59,
- 10,125, 10, 10,118,111,105,100, 32,114,103, 98,116,111, 98,119, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116,
- 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 32, 32, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,108,
-111,114, 46,114, 42, 48, 46, 51, 53, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 52, 53, 32, 43, 32, 99,111,108,111,114,
- 46, 98, 42, 48, 46, 50, 59, 32, 47, 42, 32,107,101,101,112, 32,116,104,101,115,101, 32,102, 97, 99,116,111,114,115, 32,105,110,
- 32,115,121,110, 99, 32,119,105,116,104, 32,116,101,120,116,117,114,101, 46,104, 58, 82, 71, 66, 84, 79, 66, 87, 32, 42, 47, 10,
-125, 10, 10,118,111,105,100, 32,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,
-111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,120,
-121,122, 32, 61, 32,109,105,120, 40, 99,111,108, 46,120,121,122, 44, 32,118,101, 99, 51, 40, 49, 46, 48, 44, 32, 49, 46, 48, 44,
- 32, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 46,120,121,122, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46,119,
- 32, 61, 32, 99,111,108, 46,119, 59, 10,125, 10, 10,118,111,105,100, 32,104,117,101, 95,115, 97,116, 40,102,108,111, 97,116, 32,
-104,117,101, 44, 32,102,108,111, 97,116, 32,115, 97,116, 44, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,102,108,111,
- 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
-108, 41, 10,123, 10, 9,118,101, 99, 52, 32,104,115,118, 59, 10, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108,
- 44, 32,104,115,118, 41, 59, 10, 10, 9,104,115,118, 91, 48, 93, 32, 43, 61, 32, 40,104,117,101, 32, 45, 32, 48, 46, 53, 41, 59,
- 10, 9,105,102, 40,104,115,118, 91, 48, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 48, 93, 45, 61, 49, 46, 48, 59, 32,101,108,
-115,101, 32,105,102, 40,104,115,118, 91, 48, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 48, 93, 43, 61, 32, 49, 46, 48, 59, 10,
- 9,104,115,118, 91, 49, 93, 32, 42, 61, 32,115, 97,116, 59, 10, 9,105,102, 40,104,115,118, 91, 49, 93, 62, 49, 46, 48, 41, 32,
-104,115,118, 91, 49, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 49, 93, 60, 48, 46, 48, 41,
- 32,104,115,118, 91, 49, 93, 61, 32, 48, 46, 48, 59, 10, 9,104,115,118, 91, 50, 93, 32, 42, 61, 32,118, 97,108,117,101, 59, 10,
- 9,105,102, 40,104,115,118, 91, 50, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,
-101, 32,105,102, 40,104,115,118, 91, 50, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 48, 46, 48, 59, 10, 10, 9,
-104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 10, 9,111,117,116, 99,111,
-108, 32, 61, 32,109,105,120, 40, 99,111,108, 44, 32,111,117,116, 99,111,108, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,
-105,100, 32,115,101,112, 97,114, 97,116,101, 95,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 98, 41,
- 10,123, 10, 9,114, 32, 61, 32, 99,111,108, 46,114, 59, 10, 9,103, 32, 61, 32, 99,111,108, 46,103, 59, 10, 9, 98, 32, 61, 32,
- 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,109, 98,105,110,101, 95,114,103, 98, 40,102,108,111, 97,116,
- 32,114, 44, 32,102,108,111, 97,116, 32,103, 44, 32,102,108,111, 97,116, 32, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,
-111,108, 41, 10,123, 10, 9, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114, 44, 32,103, 44, 32, 98, 44, 32, 49, 46, 48, 41, 59,
- 10,125, 10, 10,118,111,105,100, 32,111,117,116,112,117,116, 95,110,111,100,101, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,102,
-108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,
-111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125,
- 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 84, 69, 88, 84, 85, 82, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,102,108,105,112, 95, 98,108,101,110,
-100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,
-111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 46,121,120,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,
-101, 95, 98,108,101,110,100, 95,108,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
-111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47,
- 50, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95,113,117, 97,100, 40,
-118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,
-117,116,118, 97,108, 32, 61, 32,109, 97,120, 40, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, 44, 32, 48, 46, 48,
- 41, 59, 10, 9,111,117,116,118, 97,108, 32, 42, 61, 32,111,117,116,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,
-120,116,117,114,101, 95,119,111,111,100, 95,115,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111,
- 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101,
- 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, 97, 32, 61, 32,115,113,114,116, 40,118,101, 99,
- 46,120, 42,118,101, 99, 46,120, 32, 43, 32,118,101, 99, 46,121, 42,118,101, 99, 46,121, 32, 43, 32,118,101, 99, 46,122, 42,118,
-101, 99, 46,122, 41, 42, 50, 48, 46, 48, 59, 10, 9,102,108,111, 97,116, 32,119,105, 32, 61, 32, 48, 46, 53, 32, 43, 32, 48, 46,
- 53, 42,115,105,110, 40, 97, 41, 59, 10, 10, 9,118, 97,108,117,101, 32, 61, 32,119,105, 59, 10, 9, 99,111,108,111,114, 32, 61,
- 32,118,101, 99, 52, 40,119,105, 44, 32,119,105, 44, 32,119,105, 44, 32, 49, 46, 48, 41, 59, 10, 9,110,111,114,109, 97,108, 32,
- 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,
-101,120,116,117,114,101, 95,105,109, 97,103,101, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68,
- 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
- 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 99,111,108,111,114,
- 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 40,118,101, 99, 46,120,121, 32, 43, 32,118,101, 99, 50,
- 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 41, 42, 48, 46, 53, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10,
- 10, 9,110,111,114,109, 97,108, 46,120, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46,114, 32, 45, 32, 48, 46, 53, 41,
- 59, 10, 9,110,111,114,109, 97,108, 46,121, 32, 61, 32, 50, 46, 48, 42, 40, 48, 46, 53, 32, 45, 32, 99,111,108,111,114, 46,103,
- 41, 59, 10, 9,110,111,114,109, 97,108, 46,122, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46, 98, 32, 45, 32, 48, 46,
- 53, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 77, 84, 69, 88, 32, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111,114, 99,111, 40,118,
-101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 41, 10,123, 10, 9,111,
-114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,117,118, 40,
-118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10, 9, 47, 42, 32,100,
-105,115, 97, 98,108,101,100, 32,102,111,114, 32,110,111,119, 44, 32,119,111,114,107,115, 32,116,111,103,101,116,104,101,114, 32,
-119,105,116,104, 32,108,101, 97,118,105,110,103, 32,111,117,116, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103,
- 10, 9, 32, 32, 32,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,118,101, 99, 50, 40,
- 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 32, 42, 47, 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,
-116,116,117,118, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,110,111,114,109, 40,118,
-101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,
-123, 10, 9, 47, 42, 32, 99,111,114,114,101,115,112,111,110,100,115, 32,116,111, 32,115,104,105, 45, 62,111,114,110, 44, 32,119,
-104,105, 99,104, 32,105,115, 32,110,101,103, 97,116,101,100, 32,115,111, 32, 99, 97,110, 99,101,108,115, 10, 9, 32, 32, 32,111,
-117,116, 32, 98,108,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,110,101,103, 97,116,105,111,110, 32, 42, 47, 10, 9,111,
-117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10,
- 10,118,111,105,100, 32,116,101,120, 99,111, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97,110,103,101,110,116,
- 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116, 97,110,103,101,110,116, 41, 10,123, 10, 9,111,117,116,116, 97,110,
-103,101,110,116, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,116, 97,110,103,101,110,116, 46,120,121,122, 41, 59, 10,125,
- 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,103,108,111, 98, 97,108, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,
-109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 41, 10,123,
- 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40, 99,111, 44, 32,
- 49, 46, 48, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111, 98,106,101, 99,116, 40,
-109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,109, 97,116, 52, 32,111, 98,105,110,118,109, 97,116, 44, 32,
-118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111, 98,106,101, 99,116, 41, 10,123, 10, 9,111, 98,106,
-101, 99,116, 32, 61, 32, 40,111, 98,105,110,118,109, 97,116, 42, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52,
- 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,114,
-101,102,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99, 51,
- 32,114,101,102, 41, 10,123, 10, 9,114,101,102, 32, 61, 32,118,105,101,119, 32, 45, 32, 50, 46, 48, 42,100,111,116, 40,118,110,
- 44, 32,118,105,101,119, 41, 42,118,110, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,110,111,114,109, 40,118,
-101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,
-123, 10, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,110,
-101,103, 97,116,101,100, 32, 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,
-101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 98,108,101,110,
-100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,
+ 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52,
+ 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108,
+ 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10,
+ 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118,
+ 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,104,115,118, 50, 46,121, 59, 10, 9,
+ 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,
+108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116,
+ 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,
+111,102,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,
+111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,
+108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109,
+ 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,111,110,101, 61, 32,118,101, 99, 52, 40, 49,
+ 46, 48, 41, 59, 10, 9,118,101, 99, 52, 32,115, 99,114, 61, 32,111,110,101, 32, 45, 32, 40,111,110,101, 32, 45, 32, 99,111,108,
+ 50, 41, 42, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,
+ 99,111,108, 49, 32, 43, 32,102, 97, 99, 42, 40, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 42, 99,111,108, 50, 42, 99,111,
+108, 49, 32, 43, 32, 99,111,108, 49, 42,115, 99,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,108,105,110,101,
+ 97,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,
+108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108,
+ 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,
+111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108,
+ 46,114, 61, 32, 99,111,108, 49, 46,114, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 32, 45, 32,
+ 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 61, 32, 99,111,108, 49, 46,114, 32,
+ 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102,
+ 40, 99,111,108, 50, 46,103, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,
+103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,103, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,
+108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46,
+ 48, 42, 40, 99,111,108, 50, 46,103, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 62,
+ 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40,
+ 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,
+ 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98,
+ 41, 32, 45, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118, 97,108,116,111,114,103, 98, 40,102,108,111, 97,116,
+ 32,102, 97, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,111,108,111,114,109, 97,112, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, 97,108,112,104, 97, 41, 10,123,
+ 10, 9,111,117,116, 99,111,108, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,111,108,111,114,109, 97,112, 44, 32,118,
+101, 99, 50, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 41, 59, 10, 9,111,117,116, 97,108,112,104, 97, 32, 61, 32,111,117,116, 99,
+111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,114,103, 98,116,111, 98,119, 40,118,101, 99, 52, 32, 99,111,108,111,114,
+ 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 32, 32, 10,123, 10, 9,111,117,116,118, 97,108, 32,
+ 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 53, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 52, 53, 32, 43, 32,
+ 99,111,108,111,114, 46, 98, 42, 48, 46, 50, 59, 32, 47, 42, 32,107,101,101,112, 32,116,104,101,115,101, 32,102, 97, 99,116,111,
+114,115, 32,105,110, 32,115,121,110, 99, 32,119,105,116,104, 32,116,101,120,116,117,114,101, 46,104, 58, 82, 71, 66, 84, 79, 66,
+ 87, 32, 42, 47, 10,125, 10, 10,118,111,105,100, 32,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116,
+ 99,111,108, 46,120,121,122, 32, 61, 32,109,105,120, 40, 99,111,108, 46,120,121,122, 44, 32,118,101, 99, 51, 40, 49, 46, 48, 44,
+ 32, 49, 46, 48, 44, 32, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 46,120,121,122, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116,
+ 99,111,108, 46,119, 32, 61, 32, 99,111,108, 46,119, 59, 10,125, 10, 10,118,111,105,100, 32,104,117,101, 95,115, 97,116, 40,102,
+108,111, 97,116, 32,104,117,101, 44, 32,102,108,111, 97,116, 32,115, 97,116, 44, 32,102,108,111, 97,116, 32,118, 97,108,117,101,
+ 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
+111,117,116, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32,104,115,118, 59, 10, 10, 9,114,103, 98, 95,116,111, 95,104,115,
+118, 40, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,104,115,118, 91, 48, 93, 32, 43, 61, 32, 40,104,117,101, 32, 45, 32,
+ 48, 46, 53, 41, 59, 10, 9,105,102, 40,104,115,118, 91, 48, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 48, 93, 45, 61, 49, 46,
+ 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 48, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 48, 93, 43, 61, 32,
+ 49, 46, 48, 59, 10, 9,104,115,118, 91, 49, 93, 32, 42, 61, 32,115, 97,116, 59, 10, 9,105,102, 40,104,115,118, 91, 49, 93, 62,
+ 49, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 49, 93,
+ 60, 48, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 48, 46, 48, 59, 10, 9,104,115,118, 91, 50, 93, 32, 42, 61, 32,118, 97,
+108,117,101, 59, 10, 9,105,102, 40,104,115,118, 91, 50, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 49, 46, 48,
+ 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 50, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 48, 46,
+ 48, 59, 10, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 10, 9,
+111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 44, 32,111,117,116, 99,111,108, 44, 32,102, 97, 99, 41, 59, 10,
+125, 10, 10,118,111,105,100, 32,115,101,112, 97,114, 97,116,101, 95,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,103, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32, 98, 41, 10,123, 10, 9,114, 32, 61, 32, 99,111,108, 46,114, 59, 10, 9,103, 32, 61, 32, 99,111,108, 46,103, 59, 10,
+ 9, 98, 32, 61, 32, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,109, 98,105,110,101, 95,114,103, 98, 40,
+102,108,111, 97,116, 32,114, 44, 32,102,108,111, 97,116, 32,103, 44, 32,102,108,111, 97,116, 32, 98, 44, 32,111,117,116, 32,118,
+101, 99, 52, 32, 99,111,108, 41, 10,123, 10, 9, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114, 44, 32,103, 44, 32, 98, 44, 32,
+ 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,111,117,116,112,117,116, 95,110,111,100,101, 40,118,101, 99, 52, 32,114,
+103, 98, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98,
+ 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32, 97,108,112,104,
+ 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 84, 69, 88, 84, 85, 82, 69, 83, 32, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,102,108,105,112,
+ 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99,
+ 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 46,121,120,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,
+101,120,116,117,114,101, 95, 98,108,101,110,100, 95,108,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,
+108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 49, 46, 48, 43,118,101,
+ 99, 46,120, 41, 47, 50, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95,
+113,117, 97,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41,
+ 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48,
+ 44, 32, 48, 46, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 42, 61, 32,111,117,116,118, 97,108, 59, 10,125, 10, 10,118,111,
+105,100, 32,116,101,120,116,117,114,101, 95,119,111,111,100, 95,115,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,
+117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, 97, 32, 61, 32,115,113,114,
+116, 40,118,101, 99, 46,120, 42,118,101, 99, 46,120, 32, 43, 32,118,101, 99, 46,121, 42,118,101, 99, 46,121, 32, 43, 32,118,101,
+ 99, 46,122, 42,118,101, 99, 46,122, 41, 42, 50, 48, 46, 48, 59, 10, 9,102,108,111, 97,116, 32,119,105, 32, 61, 32, 48, 46, 53,
+ 32, 43, 32, 48, 46, 53, 42,115,105,110, 40, 97, 41, 59, 10, 10, 9,118, 97,108,117,101, 32, 61, 32,119,105, 59, 10, 9, 99,111,
+108,111,114, 32, 61, 32,118,101, 99, 52, 40,119,105, 44, 32,119,105, 44, 32,119,105, 44, 32, 49, 46, 48, 41, 59, 10, 9,110,111,
+114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32,116,101,120,116,117,114,101, 95,105,109, 97,103,101, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,
+108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,
+118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9,
+ 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 40,118,101, 99, 46,120,121, 32, 43,
+ 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 41, 42, 48, 46, 53, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32,
+ 49, 46, 48, 59, 10, 10, 9,110,111,114,109, 97,108, 46,120, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46,114, 32, 45,
+ 32, 48, 46, 53, 41, 59, 10, 9,110,111,114,109, 97,108, 46,121, 32, 61, 32, 50, 46, 48, 42, 40, 48, 46, 53, 32, 45, 32, 99,111,
+108,111,114, 46,103, 41, 59, 10, 9,110,111,114,109, 97,108, 46,122, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46, 98,
+ 32, 45, 32, 48, 46, 53, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 77, 84, 69, 88, 32,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111,
+114, 99,111, 40,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 41,
+ 10,123, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,
+111, 95,117,118, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10,
+ 9, 47, 42, 32,100,105,115, 97, 98,108,101,100, 32,102,111,114, 32,110,111,119, 44, 32,119,111,114,107,115, 32,116,111,103,101,
+116,104,101,114, 32,119,105,116,104, 32,108,101, 97,118,105,110,103, 32,111,117,116, 32,109,116,101,120, 95, 50,100, 95,109, 97,
+112,112,105,110,103, 10, 9, 32, 32, 32,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,
+118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 32, 42, 47, 10, 9,117,118, 32, 61, 32,118,
+101, 99, 51, 40, 97,116,116,117,118, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,110,
+111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,
+109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 99,111,114,114,101,115,112,111,110,100,115, 32,116,111, 32,115,104,105, 45, 62,111,
+114,110, 44, 32,119,104,105, 99,104, 32,105,115, 32,110,101,103, 97,116,101,100, 32,115,111, 32, 99, 97,110, 99,101,108,115, 10,
+ 9, 32, 32, 32,111,117,116, 32, 98,108,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,110,101,103, 97,116,105,111,110, 32,
+ 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97,
+110,103,101,110,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116, 97,110,103,101,110,116, 41, 10,123, 10, 9,111,
+117,116,116, 97,110,103,101,110,116, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,116, 97,110,103,101,110,116, 46,120,121,
+122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,103,108,111, 98, 97,108, 40,109, 97,116, 52, 32,118,105,
+101,119,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98,
+ 97,108, 41, 10,123, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52,
+ 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111, 98,
+106,101, 99,116, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,109, 97,116, 52, 32,111, 98,105,110,118,
+109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111, 98,106,101, 99,116, 41, 10,123,
+ 10, 9,111, 98,106,101, 99,116, 32, 61, 32, 40,111, 98,105,110,118,109, 97,116, 42, 40,118,105,101,119,105,110,118,109, 97,116,
+ 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,
+120, 99,111, 95,114,101,102,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116,
+ 32,118,101, 99, 51, 32,114,101,102, 41, 10,123, 10, 9,114,101,102, 32, 61, 32,118,105,101,119, 32, 45, 32, 50, 46, 48, 42,100,
+111,116, 40,118,110, 44, 32,118,105,101,119, 41, 42,118,110, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,110,
+111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,
+109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108,
+ 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,
+109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,
+ 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44,
+ 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42,
+ 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,
+108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125,
+ 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,109,117,108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44,
+ 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102,
+ 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48,
+ 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101,
+120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,
+ 99,114,101,101,110, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,
+102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51,
+ 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61,
+ 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108,
+ 32, 61, 32,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 51, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99,
+116, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40,118,101, 99, 51, 40, 49, 46,
+ 48, 41, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,111,
+118,101,114,108, 97,121, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44,
+ 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42,
+ 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,102, 40,111,
+117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,
+108, 46,114, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 41, 59, 10,
+ 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32,
+ 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46,114, 41, 41, 42, 40, 49, 46, 48, 32,
+ 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53,
+ 41, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 42, 40,102, 97, 99,109, 32, 43, 32, 50,
+ 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108,
+ 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48,
+ 32, 45, 32,116,101,120, 99,111,108, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10,
+ 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61,
+ 32,111,117,116, 99,111,108, 46, 98, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,
+108, 46, 98, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102,
+ 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46, 98, 41, 41,
+ 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
+114,103, 98, 95,115,117, 98, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108,
+ 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101,
+ 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32, 45,102, 97, 99,116, 42,102, 97, 99,103, 42,
+116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103,
+ 98, 95, 97,100,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,
+102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51,
+ 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120,
+ 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,
+105,118, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111,
+ 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110,
+ 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97,
+ 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,
+108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,
+108, 46,114, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,114, 47,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,
+102, 40,116,101,120, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,
+109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,103, 47,116,101,120, 99,111,
+108, 46,103, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,
+ 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,
+ 98, 47,116,101,120, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,102,
+102, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,
116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,
111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,
103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102,
- 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,
-100, 32,109,116,101,120, 95,114,103, 98, 95,109,117,108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51,
- 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
- 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10,
- 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103,
- 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41,
- 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, 99,114,101,101,110,
- 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116,
- 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,
-108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103,
- 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,118,101,
- 99, 51, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 51, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99,116, 42, 40,118,101,
- 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,
-111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,111,118,101,114,108, 97,
-121, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,
-116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,
-111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,
-103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108,
- 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 42, 40,
-102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 41, 59, 10, 9,101,108,115,101,
- 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102,
- 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116,
- 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,
-110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97,
- 99,116, 42,116,101,120, 99,111,108, 46,103, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32,
- 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,
-120, 99,111,108, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,
-111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,
-111,108, 46, 98, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 41, 59,
- 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43,
- 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46, 98, 41, 41, 42, 40, 49, 46, 48,
- 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,
-117, 98, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111,
- 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110,
- 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32, 45,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,
-108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 97,100,100,
- 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116,
- 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,
-108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,108, 32, 43,
- 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,118, 40,118,101,
+ 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,
+117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100, 97,114,107, 40,118,101,
99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97,
99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,
-123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,
-102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 46,114, 32, 33,
- 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43,
- 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,114, 47,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40,116,101,120,
- 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116,
- 99,111,108, 46,103, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,103, 47,116,101,120, 99,111,108, 46,103, 59, 10,
- 9,105,102, 40,116,101,120, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,102,
- 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46, 98, 47,116,101,120,
- 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,102,102, 40,118,101, 99,
- 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,
-116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123,
- 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102,
- 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,
-117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108,
- 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100, 97,114,107, 40,118,101, 99, 51, 32,111,117,
-116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,
-108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,
-111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,
-102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,
-120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,114, 41, 32,105,110, 99,111,
-108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108,
- 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40, 99,111,
-108, 32, 60, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, 59, 32,101,108,115,
-101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,
-116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46, 98, 41, 32,
-105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,
-116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,108,105,103,104,116, 40,118,
-101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102,
- 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41,
- 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102,
- 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102,
- 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,114,
- 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,
-111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10,
- 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,
-108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108,
- 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,
-111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,
- 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,104,
-117,101, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111,
+123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97,
+ 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97,
+ 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,114, 41,
+ 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,
+117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,
+105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108,
+ 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32,
+ 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,
+108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98,
+ 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,108,105,
+103,104,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,
+111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,
+110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116,
+ 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,
+108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116,
+ 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108,
+ 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,
+108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103,
+ 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59,
+ 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 62,
+ 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,
+110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
+114,103, 98, 95,104,117,101, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108,
+ 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101,
+ 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,104,117,101,
+ 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,
+101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,
+103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,
+ 97,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111,
97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110,
- 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,104,117,101, 40,102, 97, 99,116,
+ 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,115, 97,116, 40,102, 97, 99,116,
42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,
101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32,
- 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, 97,116, 40,118,101,
+ 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,118, 97,108, 40,118,101,
99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97,
99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,
-123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,115, 97,116, 40,102, 97, 99,116, 42,102, 97, 99,103,
+123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,118, 97,108, 40,102, 97, 99,116, 42,102, 97, 99,103,
44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108,
44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,
-103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,118, 97,108, 40,118,101, 99, 51, 32,111,117,
-116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,
-108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101,
- 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,118, 97,108, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99,
- 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48,
- 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125,
- 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 99,111,108,111,114, 40,118,101, 99, 51, 32,111,117,116, 99,111,
-108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,
-116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32,
- 99,111,108, 59, 10, 10, 9,109,105,120, 95, 99,111,108,111,114, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52,
- 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41,
- 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10,
- 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,105,110,111,117,116, 32,102,108,111, 97,
-116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97,
- 99,109, 41, 10,123, 10, 9,102, 97, 99,116, 32, 42, 61, 32, 97, 98,115, 40,102, 97, 99,103, 41, 59, 10, 9,102, 97, 99,109, 32,
- 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,102, 97, 99,103, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9,
- 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32,102, 97, 99,116, 59, 10, 9, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,109,
- 59, 10, 9, 9,102, 97, 99,109, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
-118, 97,108,117,101, 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,
-116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,
-111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10,
- 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,
-109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109,
- 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,109,117,108, 40,
-102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,
-116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,
- 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,
-118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61,
- 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97,
- 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
-118, 97,108,117,101, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116,
- 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59,
- 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97,
- 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108,
- 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120,
- 99,111,108, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
-101,120, 95,118, 97,108,117,101, 95,115,117, 98, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116,
- 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59,
- 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97,
- 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32, 45,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97,
- 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120,
- 95,118, 97,108,117,101, 95, 97,100,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,
-101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,
-117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,
-109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109,
- 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,
-116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,
-108,117,101, 95,100,105,118, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,
-111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,
-102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,
-120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10,
- 10, 9,105,102, 40,116,101,120, 99,111,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9,105,110, 99,111,108, 32, 61, 32,102, 97,
- 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 47,116,101,120, 99,111,108, 59, 10,
- 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,
-120, 95,118, 97,108,117,101, 95,100,105,102,102, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116,
- 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59,
- 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97,
- 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,
-116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
-109,116,101,120, 95,118, 97,108,117,101, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,
+103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 99,111,108,111,114, 40,118,101, 99, 51, 32,
+111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44,
+ 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,
+118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95, 99,111,108,111,114, 40,102, 97, 99,116, 42,102, 97, 99,103, 44,
+ 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44,
+ 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103,
+ 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,105,110,111,117,116,
+ 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,102, 97, 99,109, 41, 10,123, 10, 9,102, 97, 99,116, 32, 42, 61, 32, 97, 98,115, 40,102, 97, 99,103, 41, 59, 10, 9,
+102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,102, 97, 99,103, 32, 60, 32, 48, 46, 48,
+ 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32,102, 97, 99,116, 59, 10, 9, 9,102, 97, 99,116, 32, 61,
+ 32,102, 97, 99,109, 59, 10, 9, 9,102, 97, 99,109, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,
+109,116,101,120, 95,118, 97,108,117,101, 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,
+108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102,
+ 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102,
+ 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103,
+ 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43,
+ 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101,
+ 95,109,117,108, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44,
+ 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118,
+ 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,
+ 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109,
+ 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,
+109,116,101,120, 95,118, 97,108,117,101, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,
+102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,
+103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,
+105,110, 99,111,108, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42, 40, 49, 46, 48, 32,
+ 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,
+105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115,117, 98, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,
+102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,
+103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32, 45,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108,
+ 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100,
+ 32,109,116,101,120, 95,118, 97,108,117,101, 95, 97,100,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,
111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97,
99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97,
99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44,
- 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,
-108, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32, 61, 32, 99,111,108,
- 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,
-116,101,120, 95,118, 97,108,117,101, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,
-111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97,
- 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97,
- 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44,
- 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,
-108, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32, 61, 32, 99,111,108,
- 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,
-116,101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 95,112,111,115,105,116,105,118,101, 40,102,108,111, 97,116, 32,102,
- 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32,
- 61, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,
-108,117,101, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,
-117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46,
- 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104, 97,114, 95,100,105,118,105,100,101,
- 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10,
- 9,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 47, 49, 50, 56, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,
-120, 95,104, 97,114, 95,109,117,108,116,105,112,108,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,
-111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,104, 97,114, 32, 42, 61, 32, 49, 50, 56, 46,
- 48, 59, 10, 10, 9,105,102, 40,104, 97,114, 32, 60, 32, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32, 49, 46, 48, 59,
- 10, 9,101,108,115,101, 32,105,102, 40,104, 97,114, 32, 62, 32, 53, 49, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32,
- 53, 49, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 59, 10,125, 10, 10,118,111,
-105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,102,114,111,109, 95, 99,111,108, 40,118,101, 99, 52, 32, 99,111,108, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 41, 10,123, 10, 9, 97,108,112,104, 97, 32, 61, 32, 99,111,108,
- 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,116,111, 95, 99,111,108, 40,118,101,
- 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,
-116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32,
- 97,108,112,104, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,116,111,105,110,116, 40,118,101,
- 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,
-105,110,116,101,110,115,105,116,121, 32, 61, 32,100,111,116, 40,118,101, 99, 51, 40, 48, 46, 51, 53, 44, 32, 48, 46, 52, 53, 44,
- 32, 48, 46, 50, 41, 44, 32,114,103, 98, 46,114,103, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,
-108,117,101, 95,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,105,110,118, 97,108,117,101, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,111,117,116,118, 97,108,117,101, 41, 10,123, 10, 9,111,117,116,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 32,
- 45, 32,105,110,118, 97,108,117,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,105,110,118,101,
-114,116, 40,118,101, 99, 52, 32,105,110,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,
-123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,105,110,114,
-103, 98, 46,114,103, 98, 44, 32,105,110,114,103, 98, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118,
- 97,108,117,101, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,102,108,111, 97,
-116, 32,105,110,116,101,110,115,105,116,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,
-108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,102,108,
-111, 97,116, 32,102, 97, 99,116, 32, 61, 32,105,110,116,101,110,115,105,116,121, 59, 10, 9,111,117,116,105,110,116,101,110,115,
-105,116,121, 32, 61, 32,105,110,116,101,110,115,105,116,121, 42,115,116,101,110, 99,105,108, 59, 10, 9,111,117,116,115,116,101,
-110, 99,105,108, 32, 61, 32,115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,
-120, 95,114,103, 98, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,118,101, 99,
- 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108, 44, 32,111,117,116,
- 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,114,103,
- 98, 46, 97, 59, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32,114,103, 98,
- 46, 97, 42,115,116,101,110, 99,105,108, 41, 59, 10, 9,111,117,116,115,116,101,110, 99,105,108, 32, 61, 32,115,116,101,110, 99,
-105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,111,102,
-115, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,111,102,115, 44, 32,111,117,116, 32,118,101, 99, 51,
- 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,116,101,120, 99,111, 32, 43,
- 32,111,102,115, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,115,105,122,101, 40,
-118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,115,105,122,101, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
-111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,115,105,122,101, 42,116,101,120,
- 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103, 40,118,101, 99, 51,
- 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99,
- 32, 61, 32,118,101, 99, 51, 40,118,101, 99, 46,120,121, 42, 48, 46, 53, 32, 43, 32,118,101, 99, 50, 40, 48, 46, 53, 44, 32, 48,
- 46, 53, 41, 44, 32,118,101, 99, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,105,109, 97,103,101, 40,
-118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,
-108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9, 99,
-111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 59,
- 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,111,114,109,
- 97,108, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,
-116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 47, 32, 84,104,101, 32,105,110,118,101,114,116, 32,
-111,102, 32,116,104,101, 32,114,101,100, 32, 99,104, 97,110,110,101,108, 32,105,115, 32,116,111, 32,109, 97,107,101, 10, 9, 47,
- 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,109, 97,112, 32, 99,111,109,112,108,105, 97,110,116, 32,119,105,116,104, 32,
-116,104,101, 32,111,117,116,115,105,100,101, 32,119,111,114,108,100, 46, 10, 9, 47, 47, 32, 73,116, 32,110,101,101,100,115, 32,
-116,111, 32, 98,101, 32,100,111,110,101, 32, 98,101, 99, 97,117,115,101, 32,105,110, 32, 66,108,101,110,100,101,114, 10, 9, 47,
- 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,117,115,101,100, 32,112,111,105,110,116,115, 32,105,110,119, 97,114,100, 46,
- 10, 9, 47, 47, 32, 83,104,111,117,108,100, 32,116,104,105,115, 32,101,118,101,114, 32, 99,104, 97,110,103,101, 32,116,104,105,
-115, 32,110,101,103, 97,116,101, 32,109,117,115,116, 32, 98,101, 32,114,101,109,111,118,101,100, 46, 10, 32, 32, 32, 32,118,101,
- 99, 52, 32, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,
-120,121, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 50, 46, 48, 42, 40,118,101, 99, 51, 40, 45, 99,111,108,111,114, 46,
-114, 44, 32, 99,111,108,111,114, 46,103, 44, 32, 99,111,108,111,114, 46, 98, 41, 32, 45, 32,118,101, 99, 51, 40, 45, 48, 46, 53,
- 44, 32, 48, 46, 53, 44, 32, 48, 46, 53, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,
-110,111,114,109, 97,108,115, 95,105,110,105,116, 40, 32,118,101, 99, 51, 32,118, 78, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
-118, 78,111,114,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 44, 32,111,117,116, 32,102,108,111, 97,116,
- 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 32, 41, 10,123, 10, 9,118, 78,111,114,103, 32, 61, 32,118, 78, 59,
- 10, 9,118, 78, 97, 99, 99, 32, 61, 32,118, 78, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 32, 61, 32,
- 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 42, 32,104,101,108,112,101,114, 32,109,101,116,104,111,100, 32,116,111, 32,101,120,116,
-114, 97, 99,116, 32,116,104,101, 32,117,112,112,101,114, 32,108,101,102,116, 32, 51,120, 51, 32,109, 97,116,114,105,120, 32,102,
-114,111,109, 32, 97, 32, 52,120, 52, 32,109, 97,116,114,105,120, 32, 42, 47, 10,109, 97,116, 51, 32,116,111, 95,109, 97,116, 51,
- 40,109, 97,116, 52, 32,109, 52, 41, 10,123, 10, 9,109, 97,116, 51, 32,109, 51, 59, 10, 9,109, 51, 91, 48, 93, 32, 61, 32,109,
- 52, 91, 48, 93, 46,120,121,122, 59, 10, 9,109, 51, 91, 49, 93, 32, 61, 32,109, 52, 91, 49, 93, 46,120,121,122, 59, 10, 9,109,
- 51, 91, 50, 93, 32, 61, 32,109, 52, 91, 50, 93, 46,120,121,122, 59, 10, 9,114,101,116,117,114,110, 32,109, 51, 59, 10,125, 10,
- 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,111, 98,106,115,112, 97, 99,101, 40, 32,118,
-101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 10, 9, 9,
- 9, 9, 9, 9, 9, 32, 32,109, 97,116, 52, 32,109, 86,105,101,119, 44, 32,109, 97,116, 52, 32,109, 86,105,101,119, 73,110,118,
- 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 73,110,118, 44, 32, 10, 9, 9, 9, 9,
- 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 44, 32,118,101,
- 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,
-102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97,
- 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,
-111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,
-123, 10, 9,109, 97,116, 51, 32,111, 98,106, 50,118,105,101,119, 32, 61, 32,116,111, 95,109, 97,116, 51, 40,109, 86,105,101,119,
- 32, 42, 32,109, 79, 98,106, 41, 59, 10, 9,109, 97,116, 51, 32,118,105,101,119, 50,111, 98,106, 32, 61, 32,116,111, 95,109, 97,
-116, 51, 40,109, 79, 98,106, 73,110,118, 32, 42, 32,109, 86,105,101,119, 73,110,118, 41, 59, 10, 9, 10, 9,118,101, 99, 51, 32,
-118, 83,105,103,109, 97, 83, 32, 61, 32,118,105,101,119, 50,111, 98,106, 32, 42, 32,100, 70,100,120, 40, 32,115,117,114,102, 95,
-112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,118,105,101,119, 50,111, 98,106, 32,
- 42, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,110,
-111,114,109, 97,108,105,122,101, 40, 32,115,117,114,102, 95,110,111,114,109, 32, 42, 32,111, 98,106, 50,118,105,101,119, 32, 41,
- 59, 10, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 59, 10,
- 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, 9,102,
- 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, 9, 47,
- 42, 32,112,114,101,116,114, 97,110,115,102,111,114,109, 32,118, 78, 97, 99, 99, 32, 40,105,110, 32,109,116,101,120, 95, 98,117,
-109,112, 95, 97,112,112,108,121, 41, 32,117,115,105,110,103, 32,116,104,101, 32,105,110,118,101,114,115,101, 32,116,114, 97,110,
-115,112,111,115,101,100, 32, 42, 47, 10, 9,118, 82, 49, 32, 61, 32,118, 82, 49, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59,
- 10, 9,118, 82, 50, 32, 61, 32,118, 82, 50, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9,118, 78, 32, 61, 32,118, 78,
- 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101,
- 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 32, 42, 32,108,101,110,103,116,104, 40,118, 78, 41, 59, 10, 9,118, 78, 97, 99,
- 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47,
- 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,
-116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,
-116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,116,101,120,116,117,114,101,115,112, 97, 99,101, 40, 32,118,101, 99, 51,
- 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 32, 10, 9, 9, 9, 9,
- 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 44, 32,118,
-101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102,108,111, 97,
-116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,
- 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82,
- 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101,116, 32,
- 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,100, 70,100,120, 40, 32,115,117,114,102, 95,
-112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,100, 70,100,121, 40, 32,115,117,114,
-102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,115,117,114,102, 95,110,111,114,109, 59, 32, 47,
- 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111,108, 97,116,101,100, 32,118,101,114,116,101,120,
- 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32, 99,
-114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32,110,111,
-114,109, 97,108,105,122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 41, 59,
- 10, 9,102, 68,101,116, 32, 61, 32,115,105,103,110, 40, 32,100,111,116, 40,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 41,
- 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,
-101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77,
- 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,
-102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59,
- 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,118,105,101,119,115,112, 97, 99,
-101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109,
- 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,
-101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,
-117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116,
- 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,
-118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,
-116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,100, 70,100,120,
- 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,100, 70,
-100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,115,117,114,102, 95,
-110,111,114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111,108, 97,116,101,100,
- 32,118,101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115,
- 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118,
- 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105,
-103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101,
- 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99,
- 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,
-100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77,
- 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,116, 97,112, 51,
- 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111,
- 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32,
- 10,123, 10, 9,118,101, 99, 50, 32, 83, 84,108,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 59, 10, 9,118,101, 99, 50, 32,
- 83, 84,108,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41,
- 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,100, 70,100,121, 40,
-116,101,120, 99,111, 46,120,121, 41, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, 32, 72,108,108, 44, 72,108,114, 44, 72,117,108,
- 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108,108, 41,
- 44, 32, 72,108,108, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97,
- 44, 32, 83, 84,108,114, 41, 44, 32, 72,108,114, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,
-101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117,108, 41, 44, 32, 72,117,108, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,
-104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,108,114, 32, 45, 32, 72,108,108, 41, 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99,
- 97,108,101, 32, 42, 32, 40, 72,117,108, 32, 45, 32, 72,108,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
- 98,117,109,112, 95,116, 97,112, 53, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68,
- 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111,
- 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,
-101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120,
- 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 50, 32, 83, 84, 99, 32, 61, 32,116,101,120, 99,111, 46,120,121, 59, 10, 9,
-118,101, 99, 50, 32, 83, 84,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 45, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,
-120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32, 48, 46, 53, 32, 42,
- 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,100, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 45, 32,
- 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117, 32, 61, 32,116,101,120, 99,111, 46,
-120,121, 32, 43, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, 32, 72, 99, 44, 72,
-108, 44, 72,114, 44, 72,100, 44, 72,117, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,
-105,109, 97, 44, 32, 83, 84, 99, 41, 44, 32, 72, 99, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,
-114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108, 41, 44, 32, 72,108, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,
-116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,114, 41, 44, 32, 72,114, 32, 41, 59, 10, 9,114,103, 98,116,
-111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,100, 41, 44, 32, 72,100, 32, 41, 59, 10,
- 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117, 41, 44, 32, 72,
-117, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,114, 32, 45, 32, 72,108, 41,
- 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117, 32, 45, 32, 72,100, 41, 59, 10,125, 10, 10,
-118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,100,101,114,105,118, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111,
- 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,120, 44, 32,102,108,
-111, 97,116, 32,105,109, 97, 95,121, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32,
+ 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,
+102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95,118, 97,108,117,101, 95,100,105,118, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116,
+ 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59,
+ 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97,
+ 99,109, 41, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9,105,110, 99,111,108,
+ 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 47,116,101,120,
+ 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,
+100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,102,102, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,
+102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,
+103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32,
+ 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,
+118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,111,117,116, 99,111,
+108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111,
+ 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111,
+ 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,
+102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,
+116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32,
+ 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,111,117,116, 99,111,
+108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111,
+ 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111,
+ 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,
+102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,
+116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32,
+ 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 95,112,111,115,105,116,105,118,101, 40,102,108,
+111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,
+116,102, 97, 99, 32, 61, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,
+111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97,
+ 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104, 97,114, 95,100,
+105,118,105,100,101, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,
+114, 41, 10,123, 10, 9,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 47, 49, 50, 56, 46, 48, 59, 10,125, 10, 10,118,111,105,
+100, 32,109,116,101,120, 95,104, 97,114, 95,109,117,108,116,105,112,108,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,
+104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,104, 97,114, 32, 42, 61,
+ 32, 49, 50, 56, 46, 48, 59, 10, 10, 9,105,102, 40,104, 97,114, 32, 60, 32, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61,
+ 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,104, 97,114, 32, 62, 32, 53, 49, 49, 46, 48, 41, 32,111,117,116,104,
+ 97,114, 32, 61, 32, 53, 49, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 59, 10,
+125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,102,114,111,109, 95, 99,111,108, 40,118,101, 99, 52,
+ 32, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 41, 10,123, 10, 9, 97,108,112,104, 97, 32,
+ 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,116,111, 95, 99,
+111,108, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,
+114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,116,111,105,
+110,116, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121,
+ 41, 10,123, 10, 9,105,110,116,101,110,115,105,116,121, 32, 61, 32,100,111,116, 40,118,101, 99, 51, 40, 48, 46, 51, 53, 44, 32,
+ 48, 46, 52, 53, 44, 32, 48, 46, 50, 41, 44, 32,114,103, 98, 46,114,103, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95,118, 97,108,117,101, 95,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,105,110,118, 97,108,117,101, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,117,101, 41, 10,123, 10, 9,111,117,116,118, 97,108,117,101, 32, 61,
+ 32, 49, 46, 48, 32, 45, 32,105,110,118, 97,108,117,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,
+ 95,105,110,118,101,114,116, 40,118,101, 99, 52, 32,105,110,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,
+114,103, 98, 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32,
+ 45, 32,105,110,114,103, 98, 46,114,103, 98, 44, 32,105,110,114,103, 98, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,
+116,101,120, 95,118, 97,108,117,101, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44,
+ 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,
+116,101,110, 99,105,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,110,116,101,110,115,105,116,121, 41, 10,
+123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,105,110,116,101,110,115,105,116,121, 59, 10, 9,111,117,116,105,
+110,116,101,110,115,105,116,121, 32, 61, 32,105,110,116,101,110,115,105,116,121, 42,115,116,101,110, 99,105,108, 59, 10, 9,111,
+117,116,115,116,101,110, 99,105,108, 32, 61, 32,115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,
+100, 32,109,116,101,120, 95,114,103, 98, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108,
+ 44, 32,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116,
+ 32, 61, 32,114,103, 98, 46, 97, 59, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98,
+ 44, 32,114,103, 98, 46, 97, 42,115,116,101,110, 99,105,108, 41, 59, 10, 9,111,117,116,115,116,101,110, 99,105,108, 32, 61, 32,
+115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,
+110,103, 95,111,102,115, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,111,102,115, 44, 32,111,117,116,
+ 32,118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,116,101,
+120, 99,111, 32, 43, 32,111,102,115, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,
+115,105,122,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,115,105,122,101, 44, 32,111,117,116, 32,
+118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,115,105,122,
+101, 42,116,101,120, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103,
+ 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,
+117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40,118,101, 99, 46,120,121, 42, 48, 46, 53, 32, 43, 32,118,101, 99, 50, 40, 48,
+ 46, 53, 44, 32, 48, 46, 53, 41, 44, 32,118,101, 99, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,105,
+109, 97,103,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41,
+ 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111,
+ 46,120,121, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120,
+ 95,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109,
+ 97, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 47, 32, 84,104,101, 32,105,110,
+118,101,114,116, 32,111,102, 32,116,104,101, 32,114,101,100, 32, 99,104, 97,110,110,101,108, 32,105,115, 32,116,111, 32,109, 97,
+107,101, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,109, 97,112, 32, 99,111,109,112,108,105, 97,110,116, 32,
+119,105,116,104, 32,116,104,101, 32,111,117,116,115,105,100,101, 32,119,111,114,108,100, 46, 10, 9, 47, 47, 32, 73,116, 32,110,
+101,101,100,115, 32,116,111, 32, 98,101, 32,100,111,110,101, 32, 98,101, 99, 97,117,115,101, 32,105,110, 32, 66,108,101,110,100,
+101,114, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,117,115,101,100, 32,112,111,105,110,116,115, 32,105,110,
+119, 97,114,100, 46, 10, 9, 47, 47, 32, 83,104,111,117,108,100, 32,116,104,105,115, 32,101,118,101,114, 32, 99,104, 97,110,103,
+101, 32,116,104,105,115, 32,110,101,103, 97,116,101, 32,109,117,115,116, 32, 98,101, 32,114,101,109,111,118,101,100, 46, 10, 32,
+ 32, 32, 32,118,101, 99, 52, 32, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,
+101,120, 99,111, 46,120,121, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 50, 46, 48, 42, 40,118,101, 99, 51, 40, 45, 99,
+111,108,111,114, 46,114, 44, 32, 99,111,108,111,114, 46,103, 44, 32, 99,111,108,111,114, 46, 98, 41, 32, 45, 32,118,101, 99, 51,
+ 40, 45, 48, 46, 53, 44, 32, 48, 46, 53, 44, 32, 48, 46, 53, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,
+ 98,117,109,112, 95,110,111,114,109, 97,108,115, 95,105,110,105,116, 40, 32,118,101, 99, 51, 32,118, 78, 44, 32,111,117,116, 32,
+118,101, 99, 51, 32,118, 78,111,114,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 44, 32,111,117,116, 32,
+102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 32, 41, 10,123, 10, 9,118, 78,111,114,103, 32,
+ 61, 32,118, 78, 59, 10, 9,118, 78, 97, 99, 99, 32, 61, 32,118, 78, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,
+100,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 42, 32,104,101,108,112,101,114, 32,109,101,116,104,111,100, 32,116,
+111, 32,101,120,116,114, 97, 99,116, 32,116,104,101, 32,117,112,112,101,114, 32,108,101,102,116, 32, 51,120, 51, 32,109, 97,116,
+114,105,120, 32,102,114,111,109, 32, 97, 32, 52,120, 52, 32,109, 97,116,114,105,120, 32, 42, 47, 10,109, 97,116, 51, 32,116,111,
+ 95,109, 97,116, 51, 40,109, 97,116, 52, 32,109, 52, 41, 10,123, 10, 9,109, 97,116, 51, 32,109, 51, 59, 10, 9,109, 51, 91, 48,
+ 93, 32, 61, 32,109, 52, 91, 48, 93, 46,120,121,122, 59, 10, 9,109, 51, 91, 49, 93, 32, 61, 32,109, 52, 91, 49, 93, 46,120,121,
+122, 59, 10, 9,109, 51, 91, 50, 93, 32, 61, 32,109, 52, 91, 50, 93, 46,120,121,122, 59, 10, 9,114,101,116,117,114,110, 32,109,
+ 51, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,111, 98,106,115,112, 97,
+ 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,
+109, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,109, 97,116, 52, 32,109, 86,105,101,119, 44, 32,109, 97,116, 52, 32,109, 86,105,
+101,119, 73,110,118, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 73,110,118, 44, 32,
+ 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,
+110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102,
+108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,
+118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101,
+116, 32, 41, 32, 10,123, 10, 9,109, 97,116, 51, 32,111, 98,106, 50,118,105,101,119, 32, 61, 32,116,111, 95,109, 97,116, 51, 40,
+109, 86,105,101,119, 32, 42, 32,109, 79, 98,106, 41, 59, 10, 9,109, 97,116, 51, 32,118,105,101,119, 50,111, 98,106, 32, 61, 32,
+116,111, 95,109, 97,116, 51, 40,109, 79, 98,106, 73,110,118, 32, 42, 32,109, 86,105,101,119, 73,110,118, 41, 59, 10, 9, 10, 9,
+118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,118,105,101,119, 50,111, 98,106, 32, 42, 32,100, 70,100,120, 40, 32,
+115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,118,105,101,119,
+ 50,111, 98,106, 32, 42, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118,
+ 78, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,115,117,114,102, 95,110,111,114,109, 32, 42, 32,111, 98,106, 50,118,
+105,101,119, 32, 41, 59, 10, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118,
+ 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41,
+ 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59,
+ 10, 9, 10, 9, 47, 42, 32,112,114,101,116,114, 97,110,115,102,111,114,109, 32,118, 78, 97, 99, 99, 32, 40,105,110, 32,109,116,
+101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 41, 32,117,115,105,110,103, 32,116,104,101, 32,105,110,118,101,114,115,101,
+ 32,116,114, 97,110,115,112,111,115,101,100, 32, 42, 47, 10, 9,118, 82, 49, 32, 61, 32,118, 82, 49, 32, 42, 32,118,105,101,119,
+ 50,111, 98,106, 59, 10, 9,118, 82, 50, 32, 61, 32,118, 82, 50, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9,118, 78,
+ 32, 61, 32,118, 78, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,
+105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 32, 42, 32,108,101,110,103,116,104, 40,118, 78, 41, 59, 10,
+ 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,
+117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118,
+ 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,116,101,120,116,117,114,101,115,112, 97, 99,101, 40,
+ 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 32,
+ 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,
+105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,
+101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101,
+ 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
+102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,100, 70,100,120, 40, 32,
+115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,100, 70,100,121,
+ 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,115,117,114,102, 95,110,111,
+114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111,108, 97,116,101,100, 32,118,
+101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32,110,111,114,109, 97,108,105,
+122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 32, 41, 59, 10, 9,118, 82, 50,
+ 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83,
+ 32, 41, 32, 41, 59, 10, 9,102, 68,101,116, 32, 61, 32,115,105,103,110, 40, 32,100,111,116, 40,118, 83,105,103,109, 97, 83, 44,
+ 32,118, 82, 49, 41, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 97,
+ 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32,
+ 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,
+110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,
+116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,118,105,101,
+119,115,112, 97, 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102,
+ 95,110,111,114,109, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,
+110,105,116,117,100,101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9,
+ 9, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116,
+ 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,
+ 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61,
+ 32,100, 70,100,120, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84,
+ 32, 61, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,
+115,117,114,102, 95,110,111,114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111,
+108, 97,116,101,100, 32,118,101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32,
+ 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,
+115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32,
+ 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,
+105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,
+118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,
+103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116,
+ 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112,
+ 95,116, 97,112, 51, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97,
+ 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,
+ 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 83, 84,108,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 59, 10, 9,
+118,101, 99, 50, 32, 83, 84,108,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,100, 70,100,120, 40,116,101,120, 99,
+111, 46,120,121, 41, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,
+100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, 32, 72,108,108, 44, 72,108,
+114, 44, 72,117,108, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,
+ 83, 84,108,108, 41, 44, 32, 72,108,108, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50,
+ 68, 40,105,109, 97, 44, 32, 83, 84,108,114, 41, 44, 32, 72,108,114, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,
+101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117,108, 41, 44, 32, 72,117,108, 32, 41, 59, 10, 9, 10, 9,100,
+ 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,108,114, 32, 45, 32, 72,108,108, 41, 59, 10, 9,100, 66,116, 32,
+ 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117,108, 32, 45, 32, 72,108,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
+109,116,101,120, 95, 98,117,109,112, 95,116, 97,112, 53, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,
+108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,
-116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,102,108,111, 97,116, 32,115, 32, 61, 32, 49, 46, 48, 59,
- 9, 9, 47, 47, 32,110,101,103, 97,116,101, 32,116,104,105,115, 32,105,102, 32,102,108,105,112,112,101,100, 32,116,101,120,116,
-117,114,101, 32, 99,111,111,114,100,105,110, 97,116,101, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,
-120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,
-116,101,120, 99,111, 46,120,121, 41, 59, 10, 9, 10, 9, 47, 47, 32,116,104,105,115, 32,118, 97,114,105, 97,110,116, 32,117,115,
-105,110,103, 32, 97, 32,100,101,114,105,118, 97,116,105,118,101, 32,109, 97,112, 32,105,115, 32,100,101,115, 99,114,105, 98,101,
-100, 32,104,101,114,101, 10, 9, 47, 47, 32,104,116,116,112, 58, 47, 47,109,109,105,107,107,101,108,115,101,110, 51,100, 46, 98,
-108,111,103,115,112,111,116, 46, 99,111,109, 47, 50, 48, 49, 49, 47, 48, 55, 47,100,101,114,105,118, 97,116,105,118,101, 45,109,
- 97,112,115, 46,104,116,109,108, 10, 9,118,101, 99, 50, 32,100,105,109, 32, 61, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 44,
- 32,105,109, 97, 95,121, 41, 59, 10, 9,118,101, 99, 50, 32,100, 66,100,117,118, 32, 61, 32,104, 83, 99, 97,108,101, 42,100,105,
-109, 42, 40, 50, 46, 48, 42,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 46,
-120,121, 45, 49, 46, 48, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,120, 46,
-120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,120, 46,121, 59, 10, 9,100, 66,116, 32, 61, 32,100, 66,
-100,117,118, 46,120, 42, 84,101,120, 68,121, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,121, 46,
-121, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 40, 32,102,108,111, 97,
-116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101,
- 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44,
- 10, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32,111,117,116, 32,
-118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118,
- 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32,100, 66,115, 32, 42, 32,
-118, 82, 49, 32, 43, 32,100, 66,116, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32,
- 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101,114,116,117,114, 98,
-101,100, 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,111,117,116, 32, 41,
- 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 95,116,101,120,115,112, 97,
- 99,101, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,102,108,111, 97,116,
- 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 10, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,109,112,108,101,114,
- 50, 68, 32,105,109, 97, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,120, 44,
- 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9,
- 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32,111,117,116, 32,118,
-101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,
-120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,
-121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 51, 32,118, 83,117,114,102,
- 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32, 10, 9, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32,100, 66,115, 32, 47, 32,108,101,110,103,116,104, 40, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 42, 84,101,120,
- 68,120, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,120, 46,121, 41, 32, 41, 32, 42, 32,118, 82, 49, 32, 43, 32, 10,
- 9, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,116, 32, 47, 32,108,101,110,103,116,104, 40, 32,118,101, 99, 50, 40,
-105,109, 97, 95,120, 42, 84,101,120, 68,121, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,121, 46,121, 41, 32, 41, 32,
- 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 9, 9, 9, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99,
- 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109,
- 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,111,117,116, 32, 41, 59, 10,125, 10, 10,118,111,
-105,100, 32,109,116,101,120, 95,110,101,103, 97,116,101, 95,116,101,120,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,110,111,
-114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,
-110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 45,110,111,114,109, 97,108, 46,120, 44, 32, 45,110,111,114,109, 97,108,
- 46,121, 44, 32,110,111,114,109, 97,108, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,115,112, 97,
- 99,101, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97,110,103,101,110,116, 44, 32,118,101, 99, 51, 32,110,111,
-114,109, 97,108, 44, 32,118,101, 99, 51, 32,116,101,120,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,
-117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,118,101, 99, 51, 32, 66, 32, 61, 32,116, 97,110,103,101,110,116, 46,119, 32,
- 42, 32, 99,114,111,115,115, 40,110,111,114,109, 97,108, 44, 32,116, 97,110,103,101,110,116, 46,120,121,122, 41, 59, 10, 10, 9,
-111,117,116,110,111,114,109, 97,108, 32, 61, 32,116,101,120,110,111,114,109, 97,108, 46,120, 42,116, 97,110,103,101,110,116, 46,
-120,121,122, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,121, 42, 66, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,
-122, 42,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101,
- 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,108,101,110,100, 95,
-110,111,114,109, 97,108, 40,102,108,111, 97,116, 32,110,111,114,102, 97, 99, 44, 32,118,101, 99, 51, 32,110,111,114,109, 97,108,
- 44, 32,118,101, 99, 51, 32,110,101,119,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,
-114,109, 97,108, 41, 10,123, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32,110,111,114,102,
- 97, 99, 41, 42,110,111,114,109, 97,108, 32, 43, 32,110,111,114,102, 97, 99, 42,110,101,119,110,111,114,109, 97,108, 59, 10, 9,
-111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41,
- 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 32, 77, 65, 84, 69, 82, 73, 65, 76, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 47, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,117,110, 95,104,101,109,105,
- 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,
-102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123,
- 10, 9,108,118, 32, 61, 32,108, 97,109,112,118,101, 99, 59, 10, 9,100,105,115,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,118,105,
-115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,
-108,105,116,121, 95,111,116,104,101,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111, 44,
- 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,
-116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32, 99,111, 32, 45, 32,108, 97,
-109,112, 99,111, 59, 10, 9,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40,108,118, 41, 59, 10, 9,108,118, 32, 61, 32,
-110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125,
- 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,108,105,110,101, 97,114, 40,102,108,
-111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,
-115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,
-109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,115,113,117, 97,114,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,
-105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102,
- 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,
-105,115,116, 32, 43, 32,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102,
- 97,108,108,111,102,102, 95,115,108,105,100,101,114,115, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,
-108,111, 97,116, 32,108,100, 49, 44, 32,102,108,111, 97,116, 32,108,100, 50, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44,
- 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,108, 97,109,
-112,100,105,115,116,107,119, 32, 61, 32,108, 97,109,112,100,105,115,116, 42,108, 97,109,112,100,105,115,116, 59, 10, 10, 9,118,
-105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,108,100,
- 49, 42,100,105,115,116, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 42, 61, 32,108, 97,109,112,100,105,115,116,107,119, 47,
- 40,108, 97,109,112,100,105,115,116,107,119, 32, 43, 32,108,100, 50, 42,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10,
- 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95, 99,117,114,118,101, 40,102,108,111, 97,116, 32,108,
- 97,109,112,100,105,115,116, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,102,108,111,
- 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,
-105,115,105,102, 97, 99, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99,
- 50, 40,100,105,115,116, 47,108, 97,109,112,100,105,115,116, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10,125, 10, 10,118,111,105,
-100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,104,101,114,101, 40,102,108,111, 97,116, 32,108,
- 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102,
- 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111,
- 97,116, 32,116, 61, 32,108, 97,109,112,100,105,115,116, 32, 45, 32,100,105,115,116, 59, 10, 10, 9,111,117,116,118,105,115,105,
-102, 97, 99, 61, 32,118,105,115,105,102, 97, 99, 42,109, 97,120, 40,116, 44, 32, 48, 46, 48, 41, 47,108, 97,109,112,100,105,115,
-116, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 95,
-115,113,117, 97,114,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,109, 97,116, 52, 32,108, 97,109,112,105,109,
- 97,116, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,
-105,102, 40,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,118,
-101, 99, 51, 32,108,118,114,111,116, 32, 61, 32, 40,108, 97,109,112,105,109, 97,116, 42,118,101, 99, 52, 40,108,118, 44, 32, 48,
- 46, 48, 41, 41, 46,120,121,122, 59, 10, 9, 9,102,108,111, 97,116, 32,120, 32, 61, 32,109, 97,120, 40, 97, 98,115, 40,108,118,
-114,111,116, 46,120, 47,108,118,114,111,116, 46,122, 41, 44, 32, 97, 98,115, 40,108,118,114,111,116, 46,121, 47,108,118,114,111,
-116, 46,122, 41, 41, 59, 10, 10, 9, 9,105,110,112,114, 32, 61, 32, 49, 46, 48, 47,115,113,114,116, 40, 49, 46, 48, 32, 43, 32,
-120, 42,120, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 10, 9, 9,105,110,112,114, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,
-118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 95, 99,105,114, 99,108,101,
- 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,
-116, 32,105,110,112,114, 41, 10,123, 10, 9,105,110,112,114, 32, 61, 32,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101,
- 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116,
- 40,102,108,111, 97,116, 32,115,112,111,116,115,105, 44, 32,102,108,111, 97,116, 32,115,112,111,116, 98,108, 44, 32,102,108,111,
- 97,116, 32,105,110,112,114, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,
-116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 32, 61, 32,115,112,111,116,115,
-105, 59, 10, 10, 9,105,102, 40,105,110,112,114, 32, 60, 61, 32,116, 41, 32,123, 10, 9, 9,111,117,116,118,105,115,105,102, 97,
- 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 32, 61, 32,105,110,112,114, 32, 45,
- 32,116, 59, 10, 10, 9, 9, 47, 42, 32,115,111,102,116, 32, 97,114,101, 97, 32, 42, 47, 10, 9, 9,105,102, 40,115,112,111,116,
- 98,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,105,110,112,114, 32, 42, 61, 32,115,109,111,111,116,104,115,116,101,112,
- 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,116, 47,115,112,111,116, 98,108, 41, 59, 10, 10, 9, 9,111,117,116,118,105,115,105,
-102, 97, 99, 32, 61, 32,118,105,115,105,102, 97, 99, 42,105,110,112,114, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,108,
- 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,118,105,115,105,102,
- 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,111,117,116,
-118,105,115,105,102, 97, 99, 32, 61, 32, 40,118,105,115,105,102, 97, 99, 32, 60, 32, 48, 46, 48, 48, 49, 41, 63, 32, 48, 46, 48,
- 58, 32,118,105,115,105,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,118,105,101,119, 40,118,101,
- 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 41, 10,123, 10, 9, 47, 42, 32,104, 97,110,100,
-108,101, 32,112,101,114,115,112,101, 99,116,105,118,101, 47,111,114,116,104,111,103,114, 97,112,104,105, 99, 32, 42, 47, 10, 9,
-118,105,101,119, 32, 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51,
- 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 58, 32,118,101, 99, 51, 40, 48,
- 46, 48, 44, 32, 48, 46, 48, 44, 32, 45, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116, 97,
-110,103,101,110,116, 95,118, 40,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,
-118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99, 32, 61, 32, 99,114,111,115,115, 40,108,118, 44, 32,116,
- 97,110,103, 41, 59, 10, 9,118,101, 99, 51, 32,118,110,111,114, 32, 61, 32, 99,114,111,115,115, 40, 99, 44, 32,116, 97,110,103,
- 41, 59, 10, 10, 9,118,110, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,118,110,111,114, 41, 59, 10,125, 10, 10,118,
-111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,
-111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,105,110,112, 32, 61, 32,100,111,116, 40,118,110, 44, 32,
-108,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,110,111, 95,100,105,102,102,117,115,101,
- 40,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,
-111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,104,101,109,105, 40,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116,
- 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 53, 42,105,110,112, 32, 43, 32, 48, 46, 53,
- 59, 10,125, 10, 10,102,108,111, 97,116, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, 40,109, 97,116, 52,
- 32, 97,114,101, 97, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51,
- 32,118,101, 99, 91, 52, 93, 44, 32, 99, 91, 52, 93, 59, 10, 9,102,108,111, 97,116, 32,114, 97,100, 91, 52, 93, 44, 32,102, 97,
- 99, 59, 10, 9, 10, 9,118,101, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,
-101, 97, 91, 48, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,
- 99,111, 32, 45, 32, 97,114,101, 97, 91, 49, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 50, 93, 32, 61, 32,110,111,114,
-109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 50, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 51,
- 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 51, 93, 46,120,121,122, 41, 59,
- 10, 10, 9, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 48, 93,
- 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,
-111,115,115, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9, 99, 91, 50, 93, 32, 61, 32,110,111,
-114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10,
- 9, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 51, 93, 44, 32,
-118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,114, 97,100, 91, 48, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101,
- 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 49, 93, 32, 61, 32, 97, 99,111,115, 40,100,
-111,116, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 50, 93, 32, 61, 32, 97,
- 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 51,
- 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10,
- 9,102, 97, 99, 61, 32, 32,114, 97,100, 91, 48, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 48, 93, 41, 59, 10, 9,102, 97,
- 99, 43, 61, 32,114, 97,100, 91, 49, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 49, 93, 41, 59, 10, 9,102, 97, 99, 43, 61,
- 32,114, 97,100, 91, 50, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 50, 93, 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,
-100, 91, 51, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 51, 93, 41, 59, 10, 10, 9,114,101,116,117,114,110, 32,109, 97,120,
- 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 95, 97,114,
-101, 97, 40,118,101, 99, 51, 32,112,111,115,105,116,105,111,110, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111, 44, 32,118,
-101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,109, 97,116, 52, 32, 97,114,101, 97, 44,
- 32,102,108,111, 97,116, 32, 97,114,101, 97,115,105,122,101, 44, 32,102,108,111, 97,116, 32,107, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99,111, 32, 61, 32,112,111,115,105,116,105,111,110, 59, 10,
- 9,118,101, 99, 51, 32,118,101, 99, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 10, 9,105,102, 40,100,111,
-116, 40,118,101, 99, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,110,112, 32, 61,
- 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,105,110,116,101,110,115, 32,
- 61, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, 40, 97,114,101, 97, 44, 32, 99,111, 44, 32,118,110, 41,
- 59, 10, 10, 9, 9,105,110,112, 32, 61, 32,112,111,119, 40,105,110,116,101,110,115, 42, 97,114,101, 97,115,105,122,101, 44, 32,
-107, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,111,114,101,
-110, 95,110, 97,121,101,114, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108,
- 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104, 44, 32,111,117,116, 32,102,108,111, 97,116,
- 32,105,115, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108,
- 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46,
- 48, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48,
- 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,114,101, 97,108,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10,
- 10, 9,105,102, 40,114,101, 97,108,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59,
- 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32,
- 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,120,
- 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 76,105,116, 95, 65, 32,
- 61, 32, 97, 99,111,115, 40,114,101, 97,108,110,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 86,105,101,119, 95, 65, 32, 61,
- 32, 97, 99,111,115, 40,110,118, 41, 59, 10, 10, 9, 9,118,101, 99, 51, 32, 76,105,116, 95, 66, 32, 61, 32,110,111,114,109, 97,
-108,105,122,101, 40,108, 32, 45, 32,114,101, 97,108,110,108, 42,110, 41, 59, 10, 9, 9,118,101, 99, 51, 32, 86,105,101,119, 95,
- 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 45, 32,110,118, 42,110, 41, 59, 10, 10, 9, 9,102,108,111, 97,
-116, 32,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 76,105,116, 95, 66, 44, 32, 86,105,101,119, 95, 66, 41, 44, 32, 48, 46,
- 48, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 97, 44, 32, 98, 59, 10, 10, 9, 9,105,102, 40, 76,105,116, 95, 65, 32, 62,
- 32, 86,105,101,119, 95, 65, 41, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32,
- 86,105,101,119, 95, 65, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 86,105,101,119,
- 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9,125, 10, 10, 9, 9,102,108,111, 97,116, 32, 65,
- 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 48, 46, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47, 40, 40,114,
-111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 51, 51, 41, 41, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 66,
- 32, 61, 32, 48, 46, 52, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47, 40, 40,114,111,117,103,104, 42,114,
-111,117,103,104, 41, 32, 43, 32, 48, 46, 48, 57, 41, 41, 59, 10, 10, 9, 9, 98, 32, 42, 61, 32, 48, 46, 57, 53, 59, 10, 9, 9,
-105,115, 32, 61, 32,110,108, 42, 40, 65, 32, 43, 32, 40, 66, 32, 42, 32,116, 32, 42, 32,115,105,110, 40, 97, 41, 32, 42, 32,116,
- 97,110, 40, 98, 41, 41, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,
-101, 95,116,111,111,110, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,
-108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,105,115, 41, 10,123, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,110, 44, 32,108,
- 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,105,102,
- 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,105,115, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,
- 97,110,103, 32, 62, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,115,109,111,111,116,
-104, 32, 61, 61, 32, 48, 46, 48, 41, 32,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,115, 32, 61, 32, 49,
- 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41, 59, 10,125, 10, 10,
-118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,109,105,110,110, 97,101,114,116, 40,102,108,111, 97,
-116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,100, 97,114,107,
-110,101,115,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,102, 40,110,108, 32, 60, 61, 32,
- 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,
-102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10,
- 10, 9, 9,105,102, 40,100, 97,114,107,110,101,115,115, 32, 60, 61, 32, 49, 46, 48, 41, 10, 9, 9, 9,105,115, 32, 61, 32,110,
-108, 42,112,111,119, 40,109, 97,120, 40,110,118, 42,110,108, 44, 32, 48, 46, 49, 41, 44, 32,100, 97,114,107,110,101,115,115, 32,
- 45, 32, 49, 46, 48, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112,111,119, 40, 49, 46,
- 48, 48, 48, 49, 32, 45, 32,110,118, 44, 32,100, 97,114,107,110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9,125, 10,125,
- 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,102, 97, 99, 40,118,101, 99, 51, 32,118,105,101,119, 44, 32,118,
-101, 99, 51, 32,118,110, 44, 32,102,108,111, 97,116, 32,103,114, 97,100, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123,
- 10, 9,102,108,111, 97,116, 32,116, 49, 44, 32,116, 50, 59, 10, 9,102,108,111, 97,116, 32,102,102, 97, 99, 59, 10, 10, 9,105,
-102, 40,102, 97, 99, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9,125, 10, 9,
-101,108,115,101, 32,123, 10, 9, 9,116, 49, 61, 32,100,111,116, 40,118,105,101,119, 44, 32,118,110, 41, 59, 10, 9, 9,105,102,
- 40,116, 49, 62, 48, 46, 48, 41, 32, 32,116, 50, 61, 32, 49, 46, 48, 43,116, 49, 59, 10, 9, 9,101,108,115,101, 32,116, 50, 61,
- 32, 49, 46, 48, 45,116, 49, 59, 10, 10, 9, 9,116, 50, 61, 32,103,114, 97,100, 32, 43, 32, 40, 49, 46, 48, 45,103,114, 97,100,
- 41, 42,112,111,119, 40,116, 50, 44, 32,102, 97, 99, 41, 59, 10, 10, 9, 9,105,102, 40,116, 50, 60, 48, 46, 48, 41, 32,102,102,
- 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40,116, 50, 62, 49, 46, 48, 41, 32,102,102, 97, 99,
- 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,102,102, 97, 99, 32, 61, 32,116, 50, 59, 10, 9,125, 10, 10, 9,114,
-101,116,117,114,110, 32,102,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,
-101, 95,102,114,101,115,110,101,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51,
- 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 95,105, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,
-117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32,102,114,101,115,110,101,108, 95,102, 97, 99,
- 40,108,118, 44, 32,118,110, 44, 32,102, 97, 99, 95,105, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104,
- 97,100,101, 95, 99,117, 98,105, 99, 40,102,108,111, 97,116, 32,105,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,
-116,105,115, 41, 10,123, 10, 9,105,102, 40,105,115, 62, 48, 46, 48, 32, 38, 38, 32,105,115, 60, 49, 46, 48, 41, 10, 9, 9,111,
-117,116,105,115, 61, 32,115,109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,105,115, 41, 59, 10,
- 9,101,108,115,101, 10, 9, 9,111,117,116,105,115, 61, 32,105,115, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101,
- 95,118,105,115,105,102, 97, 99, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44,
- 32,102,108,111, 97,116, 32,114,101,102,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105, 41, 10,123, 10, 9,
- 47, 42,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 42, 47, 10, 9, 9,111,117,116,105, 32, 61, 32,109, 97,120, 40,105, 42,118,
-105,115,105,102, 97, 99, 42,114,101,102,108, 44, 32, 48, 46, 48, 41, 59, 10, 9, 47, 42,101,108,115,101, 10, 9, 9,111,117,116,
-105, 32, 61, 32,105, 59, 42, 47, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116, 97,110,103,101,110,116, 95,118,
- 95,115,112,101, 99, 40,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10,
- 9,118,110, 32, 61, 32,116, 97,110,103, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,116,111,
- 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,105, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111,108, 44, 32,
-118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,105,102,
- 40,105, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,105, 42,108, 97,109,112, 99,111,108, 42, 99,
-111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48,
- 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,104,101,109,105, 95,115,112,101,
- 99, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,
-108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,102,108,111, 97,116, 32,118,105,115,
-105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,108,118, 32, 43, 61, 32,118,105,101,119,
- 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 10, 9,116, 32, 61, 32,100,111,116,
- 40,118,110, 44, 32,108,118, 41, 59, 10, 9,116, 32, 61, 32, 48, 46, 53, 42,116, 32, 43, 32, 48, 46, 53, 59, 10, 10, 9,116, 32,
- 61, 32,118,105,115,105,102, 97, 99, 42,115,112,101, 99, 42,112,111,119, 40,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,
-118,111,105,100, 32,115,104, 97,100,101, 95,112,104,111,110,103, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101,
- 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,
-111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,
-122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,109, 97,120, 40,100,111,116,
- 40,104, 44, 32,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,112,111,119, 40,114,115,
-108,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 99,111,111,107,116,111,114,
-114, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,
-108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10,
- 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111,
- 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 10, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48,
- 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10,
- 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41,
- 59, 10, 9, 9,102,108,111, 97,116, 32,105, 32, 61, 32,112,111,119, 40,110,104, 44, 32,104, 97,114,100, 41, 59, 10, 10, 9, 9,
-105, 32, 61, 32,105, 47, 40, 48, 46, 49, 43,110,118, 41, 59, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,105, 59, 10, 9,
-125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 98,108,105,110,110, 95,115,112,101, 99, 40,118,101, 99, 51, 32,
-110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,101,102,114, 97, 99, 44,
- 32,102,108,111, 97,116, 32,115,112,101, 99, 95,112,111,119,101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101,
- 99,102, 97, 99, 41, 10,123, 10, 9,105,102, 40,114,101,102,114, 97, 99, 32, 60, 32, 49, 46, 48, 41, 32,123, 10, 9, 9,115,112,
-101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,115,112,101, 99, 95,112,111,
-119,101,114, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,
-125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,115,112,101, 99, 95,112,111,119,101,114, 60, 49, 48, 48, 46, 48, 41,
- 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32,115,113,114,116, 40, 49, 46, 48, 47,115,112,101, 99, 95,112,111,
-119,101,114, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32, 49, 48, 46, 48,
- 47,115,112,101, 99, 95,112,111,119,101,114, 59, 10, 10, 9, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,
-122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104,
- 41, 59, 10, 9, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61,
- 32, 48, 46, 48, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61,
- 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 9, 9, 9,102,108,111, 97,116, 32,
-110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9, 9, 9,105,102, 40,110,108, 32, 60, 61, 32, 48, 46, 48, 49,
- 41, 32,123, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 9,125, 10, 9, 9, 9,101,
-108,115,101, 32,123, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,
-104, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97, 32, 61, 32, 49, 46, 48, 59, 10, 9,
- 9, 9, 9,102,108,111, 97,116, 32, 98, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,118, 41, 47,118,104, 59, 10, 9, 9, 9,
- 9,102,108,111, 97,116, 32, 99, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,108, 41, 47,118,104, 59, 10, 10, 9, 9, 9, 9,
-102,108,111, 97,116, 32,103, 32, 61, 32, 48, 46, 48, 59, 10, 10, 9, 9, 9, 9,105,102, 40, 97, 32, 60, 32, 98, 32, 38, 38, 32,
- 97, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 97, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,102, 40, 98, 32, 60, 32, 97, 32,
- 38, 38, 32, 98, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 98, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,102, 40, 99, 32, 60,
- 32, 97, 32, 38, 38, 32, 99, 32, 60, 32, 98, 41, 32,103, 32, 61, 32, 99, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,112,
- 32, 61, 32,115,113,114,116, 40, 40, 40,114,101,102,114, 97, 99, 32, 42, 32,114,101,102,114, 97, 99, 41, 43, 40,118,104, 42,118,
-104, 41, 45, 49, 46, 48, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,102, 32, 61, 32, 40, 40, 40,112, 45,118,104, 41,
- 42, 40,112, 45,118,104, 41, 41, 47, 40, 40,112, 43,118,104, 41, 42, 40,112, 43,118,104, 41, 41, 41, 42, 40, 49, 46, 48, 43, 40,
- 40, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 42, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45,
- 49, 46, 48, 41, 41, 47, 40, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 42, 40, 40,118,104, 42, 40,112,
- 45,118,104, 41, 41, 43, 49, 46, 48, 41, 41, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97,
- 99,111,115, 40,110,104, 41, 59, 10, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,109, 97,120, 40,102, 42,103, 42,
-101,120,112, 95, 98,108,101,110,100,101,114, 40, 40, 45, 40, 97,110,103, 42, 97,110,103, 41, 47, 40, 50, 46, 48, 42,115,112,101,
- 99, 95,112,111,119,101,114, 42,115,112,101, 99, 95,112,111,119,101,114, 41, 41, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 9,
-125, 10, 9, 9,125, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119, 97,114,100,105,115,111, 95,115,
+116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100,
+ 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,
+121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 50, 32, 83, 84, 99, 32, 61, 32,116,101,120, 99,111, 46,
+120,121, 59, 10, 9,118,101, 99, 50, 32, 83, 84,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 45, 32, 48, 46, 53, 32, 42,
+ 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,
+ 48, 46, 53, 32, 42, 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,100, 32, 61, 32,116,101,120, 99,111, 46,
+120,121, 32, 45, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117, 32, 61, 32,116,
+101,120, 99,111, 46,120,121, 32, 43, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9, 10, 9,102,108,111, 97,116,
+ 32, 72, 99, 44, 72,108, 44, 72,114, 44, 72,100, 44, 72,117, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,
+114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84, 99, 41, 44, 32, 72, 99, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,
+116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108, 41, 44, 32, 72,108, 32, 41, 59, 10, 9,114,103, 98,116,
+111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,114, 41, 44, 32, 72,114, 32, 41, 59, 10,
+ 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,100, 41, 44, 32, 72,
+100, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,
+117, 41, 44, 32, 72,117, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,114, 32,
+ 45, 32, 72,108, 41, 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117, 32, 45, 32, 72,100, 41,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,100,101,114,105,118, 40, 32,118,101, 99, 51, 32,
+116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,
+120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,
+115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,102,108,111, 97,116, 32,115, 32, 61,
+ 32, 49, 46, 48, 59, 9, 9, 47, 47, 32,110,101,103, 97,116,101, 32,116,104,105,115, 32,105,102, 32,102,108,105,112,112,101,100,
+ 32,116,101,120,116,117,114,101, 32, 99,111,111,114,100,105,110, 97,116,101, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32,
+ 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,
+100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9, 10, 9, 47, 47, 32,116,104,105,115, 32,118, 97,114,105, 97,
+110,116, 32,117,115,105,110,103, 32, 97, 32,100,101,114,105,118, 97,116,105,118,101, 32,109, 97,112, 32,105,115, 32,100,101,115,
+ 99,114,105, 98,101,100, 32,104,101,114,101, 10, 9, 47, 47, 32,104,116,116,112, 58, 47, 47,109,109,105,107,107,101,108,115,101,
+110, 51,100, 46, 98,108,111,103,115,112,111,116, 46, 99,111,109, 47, 50, 48, 49, 49, 47, 48, 55, 47,100,101,114,105,118, 97,116,
+105,118,101, 45,109, 97,112,115, 46,104,116,109,108, 10, 9,118,101, 99, 50, 32,100,105,109, 32, 61, 32,118,101, 99, 50, 40,105,
+109, 97, 95,120, 44, 32,105,109, 97, 95,121, 41, 59, 10, 9,118,101, 99, 50, 32,100, 66,100,117,118, 32, 61, 32,104, 83, 99, 97,
+108,101, 42,100,105,109, 42, 40, 50, 46, 48, 42,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111,
+ 46,120,121, 41, 46,120,121, 45, 49, 46, 48, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,
+101,120, 68,120, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,120, 46,121, 59, 10, 9,100, 66,116,
+ 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,121, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,
+101,120, 68,121, 46,121, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 40,
+ 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,102,108,111, 97,116, 32,100, 66,
+116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99,
+ 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44,
+ 32,111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,
+101, 99, 51, 32,118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32,100,
+ 66,115, 32, 42, 32,118, 82, 49, 32, 43, 32,100, 66,116, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 10, 9,118, 78, 97, 99, 99,
+ 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101,
+114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,
+111,117,116, 32, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 95,116,
+101,120,115,112, 97, 99,101, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,
+102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,
+109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,102,108,111, 97,116, 32,105,
+109, 97, 95,120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110,
+ 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32,
+111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,101,
+ 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50,
+ 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 51, 32,
+118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32, 10, 9, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,115, 32, 47, 32,108,101,110,103,116,104, 40, 32,118,101, 99, 50, 40,105,109, 97, 95,
+120, 42, 84,101,120, 68,120, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,120, 46,121, 41, 32, 41, 32, 42, 32,118, 82,
+ 49, 32, 43, 32, 10, 9, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,116, 32, 47, 32,108,101,110,103,116,104, 40, 32,
+118,101, 99, 50, 40,105,109, 97, 95,120, 42, 84,101,120, 68,121, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,121, 46,
+121, 41, 32, 41, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 9, 9, 9, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,
+118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101,114,116,117,114, 98,101,100,
+ 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,111,117,116, 32, 41, 59, 10,
+125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,101,103, 97,116,101, 95,116,101,120,110,111,114,109, 97,108, 40,118,101,
+ 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123,
+ 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 45,110,111,114,109, 97,108, 46,120, 44, 32, 45,110,
+111,114,109, 97,108, 46,121, 44, 32,110,111,114,109, 97,108, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120,
+ 95,110,115,112, 97, 99,101, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97,110,103,101,110,116, 44, 32,118,101,
+ 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,116,101,120,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,
+101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,118,101, 99, 51, 32, 66, 32, 61, 32,116, 97,110,103,101,
+110,116, 46,119, 32, 42, 32, 99,114,111,115,115, 40,110,111,114,109, 97,108, 44, 32,116, 97,110,103,101,110,116, 46,120,121,122,
+ 41, 59, 10, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,116,101,120,110,111,114,109, 97,108, 46,120, 42,116, 97,110,
+103,101,110,116, 46,120,121,122, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,121, 42, 66, 32, 43, 32,116,101,120,110,111,
+114,109, 97,108, 46,122, 42,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109,
+ 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,
+108,101,110,100, 95,110,111,114,109, 97,108, 40,102,108,111, 97,116, 32,110,111,114,102, 97, 99, 44, 32,118,101, 99, 51, 32,110,
+111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,110,101,119,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
+111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 40, 49, 46, 48, 32, 45,
+ 32,110,111,114,102, 97, 99, 41, 42,110,111,114,109, 97,108, 32, 43, 32,110,111,114,102, 97, 99, 42,110,101,119,110,111,114,109,
+ 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111,
+114,109, 97,108, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 32, 77, 65, 84, 69, 82, 73, 65, 76, 32, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,117,110,
+ 95,104,101,109,105, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102,
+ 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32,108, 97,109,112,118,101, 99, 59, 10, 9,100,105,115,116, 32, 61, 32, 49, 46, 48,
+ 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,
+105,115,105, 98,105,108,105,116,121, 95,111,116,104,101,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,
+109,112, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,
+116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32, 99,111,
+ 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 9,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40,108,118, 41, 59, 10, 9,
+108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49,
+ 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,108,105,110,101,
+ 97,114, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108,
+ 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,
+105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,115,113,117, 97,114,101, 40,102,108,111, 97,116, 32,
+108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
+118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,
+108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108,
+ 97,109,112, 95,102, 97,108,108,111,102,102, 95,115,108,105,100,101,114,115, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,
+115,116, 44, 32,102,108,111, 97,116, 32,108,100, 49, 44, 32,102,108,111, 97,116, 32,108,100, 50, 44, 32,102,108,111, 97,116, 32,
+100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,
+116, 32,108, 97,109,112,100,105,115,116,107,119, 32, 61, 32,108, 97,109,112,100,105,115,116, 42,108, 97,109,112,100,105,115,116,
+ 59, 10, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116,
+ 32, 43, 32,108,100, 49, 42,100,105,115,116, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 42, 61, 32,108, 97,109,112,100,105,
+115,116,107,119, 47, 40,108, 97,109,112,100,105,115,116,107,119, 32, 43, 32,108,100, 50, 42,100,105,115,116, 42,100,105,115,116,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95, 99,117,114,118,101, 40,102,108,
+111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112,
+ 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41,
+ 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112,
+ 44, 32,118,101, 99, 50, 40,100,105,115,116, 47,108, 97,109,112,100,105,115,116, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10,125,
+ 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,104,101,114,101, 40,102,108,
+111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,102,108,111, 97,116, 32,
+118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123,
+ 10, 9,102,108,111, 97,116, 32,116, 61, 32,108, 97,109,112,100,105,115,116, 32, 45, 32,100,105,115,116, 59, 10, 10, 9,111,117,
+116,118,105,115,105,102, 97, 99, 61, 32,118,105,115,105,102, 97, 99, 42,109, 97,120, 40,116, 44, 32, 48, 46, 48, 41, 47,108, 97,
+109,112,100,105,115,116, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,
+115,112,111,116, 95,115,113,117, 97,114,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,109, 97,116, 52, 32,108,
+ 97,109,112,105,109, 97,116, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112,114,
+ 41, 10,123, 10, 9,105,102, 40,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 62, 32, 48, 46, 48, 41, 32,
+123, 10, 9, 9,118,101, 99, 51, 32,108,118,114,111,116, 32, 61, 32, 40,108, 97,109,112,105,109, 97,116, 42,118,101, 99, 52, 40,
+108,118, 44, 32, 48, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9, 9,102,108,111, 97,116, 32,120, 32, 61, 32,109, 97,120, 40, 97,
+ 98,115, 40,108,118,114,111,116, 46,120, 47,108,118,114,111,116, 46,122, 41, 44, 32, 97, 98,115, 40,108,118,114,111,116, 46,121,
+ 47,108,118,114,111,116, 46,122, 41, 41, 59, 10, 10, 9, 9,105,110,112,114, 32, 61, 32, 49, 46, 48, 47,115,113,114,116, 40, 49,
+ 46, 48, 32, 43, 32,120, 42,120, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 10, 9, 9,105,110,112,114, 32, 61, 32, 48, 46, 48,
+ 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 95, 99,
+105,114, 99,108,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,105,110,112,114, 32, 61, 32,100,111,116, 40,108,118, 44, 32,108,
+ 97,109,112,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121,
+ 95,115,112,111,116, 40,102,108,111, 97,116, 32,115,112,111,116,115,105, 44, 32,102,108,111, 97,116, 32,115,112,111,116, 98,108,
+ 44, 32,102,108,111, 97,116, 32,105,110,112,114, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 32, 61, 32,
+115,112,111,116,115,105, 59, 10, 10, 9,105,102, 40,105,110,112,114, 32, 60, 61, 32,116, 41, 32,123, 10, 9, 9,111,117,116,118,
+105,115,105,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 32, 61, 32,105,
+110,112,114, 32, 45, 32,116, 59, 10, 10, 9, 9, 47, 42, 32,115,111,102,116, 32, 97,114,101, 97, 32, 42, 47, 10, 9, 9,105,102,
+ 40,115,112,111,116, 98,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,105,110,112,114, 32, 42, 61, 32,115,109,111,111,116,
+104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,116, 47,115,112,111,116, 98,108, 41, 59, 10, 10, 9, 9,111,117,
+116,118,105,115,105,102, 97, 99, 32, 61, 32,118,105,115,105,102, 97, 99, 42,105,110,112,114, 59, 10, 9,125, 10,125, 10, 10,118,
+111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,
+118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123,
+ 10, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 40,118,105,115,105,102, 97, 99, 32, 60, 32, 48, 46, 48, 48, 49, 41,
+ 63, 32, 48, 46, 48, 58, 32,118,105,115,105,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,118,105,
+101,119, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 41, 10,123, 10, 9, 47, 42,
+ 32,104, 97,110,100,108,101, 32,112,101,114,115,112,101, 99,116,105,118,101, 47,111,114,116,104,111,103,114, 97,112,104,105, 99,
+ 32, 42, 47, 10, 9,118,105,101,119, 32, 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120,
+ 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 58, 32,118,
+101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 45, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,116, 97,110,103,101,110,116, 95,118, 40,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,116, 97,110,103, 44,
+ 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99, 32, 61, 32, 99,114,111,115,115, 40,
+108,118, 44, 32,116, 97,110,103, 41, 59, 10, 9,118,101, 99, 51, 32,118,110,111,114, 32, 61, 32, 99,114,111,115,115, 40, 99, 44,
+ 32,116, 97,110,103, 41, 59, 10, 10, 9,118,110, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,118,110,111,114, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51,
+ 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,105,110,112, 32, 61, 32,100,111,116,
+ 40,118,110, 44, 32,108,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,110,111, 95,100,105,
+102,102,117,115,101, 40,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 48, 59,
+ 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,104,101,109,105, 40,102,108,111, 97,116, 32,105,110,112,
+ 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 53, 42,105,110,112, 32,
+ 43, 32, 48, 46, 53, 59, 10,125, 10, 10,102,108,111, 97,116, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121,
+ 40,109, 97,116, 52, 32, 97,114,101, 97, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10,
+ 9,118,101, 99, 51, 32,118,101, 99, 91, 52, 93, 44, 32, 99, 91, 52, 93, 59, 10, 9,102,108,111, 97,116, 32,114, 97,100, 91, 52,
+ 93, 44, 32,102, 97, 99, 59, 10, 9, 10, 9,118,101, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111,
+ 32, 45, 32, 97,114,101, 97, 91, 48, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,
+108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 49, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 50, 93, 32,
+ 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 50, 93, 46,120,121,122, 41, 59, 10, 9,
+118,101, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 51, 93, 46,
+120,121,122, 41, 59, 10, 10, 9, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,
+101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,108,105,
+122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9, 99, 91, 50, 93,
+ 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51,
+ 93, 41, 41, 59, 10, 9, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99,
+ 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,114, 97,100, 91, 48, 93, 32, 61, 32, 97, 99,111,115, 40,100,
+111,116, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 49, 93, 32, 61, 32, 97,
+ 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 50,
+ 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10, 9,
+114, 97,100, 91, 51, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93,
+ 41, 41, 59, 10, 10, 9,102, 97, 99, 61, 32, 32,114, 97,100, 91, 48, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 48, 93, 41,
+ 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 49, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 49, 93, 41, 59, 10, 9,
+102, 97, 99, 43, 61, 32,114, 97,100, 91, 50, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 50, 93, 41, 59, 10, 9,102, 97, 99,
+ 43, 61, 32,114, 97,100, 91, 51, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 51, 93, 41, 59, 10, 10, 9,114,101,116,117,114,
+110, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,
+110,112, 95, 97,114,101, 97, 40,118,101, 99, 51, 32,112,111,115,105,116,105,111,110, 44, 32,118,101, 99, 51, 32,108, 97,109,112,
+ 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,109, 97,116, 52, 32,
+ 97,114,101, 97, 44, 32,102,108,111, 97,116, 32, 97,114,101, 97,115,105,122,101, 44, 32,102,108,111, 97,116, 32,107, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99,111, 32, 61, 32,112,111,115,105,116,
+105,111,110, 59, 10, 9,118,101, 99, 51, 32,118,101, 99, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 10, 9,
+105,102, 40,100,111,116, 40,118,101, 99, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,
+105,110,112, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,105,110,
+116,101,110,115, 32, 61, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, 40, 97,114,101, 97, 44, 32, 99,111,
+ 44, 32,118,110, 41, 59, 10, 10, 9, 9,105,110,112, 32, 61, 32,112,111,119, 40,105,110,116,101,110,115, 42, 97,114,101, 97,115,
+105,122,101, 44, 32,107, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,
+101, 95,111,114,101,110, 95,110, 97,121,101,114, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,
+101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104, 44, 32,111,117,116, 32,
+102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,
+118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104,
+ 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,
+118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,114,101, 97,108,110,108, 32, 61, 32,100,111,116, 40,110, 44,
+ 32,108, 41, 59, 10, 10, 9,105,102, 40,114,101, 97,108,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61,
+ 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,
+105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,118,104, 32,
+ 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 76,
+105,116, 95, 65, 32, 61, 32, 97, 99,111,115, 40,114,101, 97,108,110,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 86,105,101,
+119, 95, 65, 32, 61, 32, 97, 99,111,115, 40,110,118, 41, 59, 10, 10, 9, 9,118,101, 99, 51, 32, 76,105,116, 95, 66, 32, 61, 32,
+110,111,114,109, 97,108,105,122,101, 40,108, 32, 45, 32,114,101, 97,108,110,108, 42,110, 41, 59, 10, 9, 9,118,101, 99, 51, 32,
+ 86,105,101,119, 95, 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 45, 32,110,118, 42,110, 41, 59, 10, 10, 9,
+ 9,102,108,111, 97,116, 32,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 76,105,116, 95, 66, 44, 32, 86,105,101,119, 95, 66,
+ 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 97, 44, 32, 98, 59, 10, 10, 9, 9,105,102, 40, 76,105,
+116, 95, 65, 32, 62, 32, 86,105,101,119, 95, 65, 41, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9,
+ 9, 98, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 97, 32, 61,
+ 32, 86,105,101,119, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9,125, 10, 10, 9, 9,102,108,
+111, 97,116, 32, 65, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 48, 46, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104,
+ 41, 47, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 51, 51, 41, 41, 41, 59, 10, 9, 9,102,108,
+111, 97,116, 32, 66, 32, 61, 32, 48, 46, 52, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47, 40, 40,114,111,
+117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 48, 57, 41, 41, 59, 10, 10, 9, 9, 98, 32, 42, 61, 32, 48, 46, 57,
+ 53, 59, 10, 9, 9,105,115, 32, 61, 32,110,108, 42, 40, 65, 32, 43, 32, 40, 66, 32, 42, 32,116, 32, 42, 32,115,105,110, 40, 97,
+ 41, 32, 42, 32,116, 97,110, 40, 98, 41, 41, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,
+105,102,102,117,115,101, 95,116,111,111,110, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51,
+ 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116,
+ 40,110, 44, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59,
+ 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,105,115, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,
+101, 32,105,102, 40, 97,110,103, 32, 62, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,
+115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,
+115, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41,
+ 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,109,105,110,110, 97,101,114,116,
+ 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116,
+ 32,100, 97,114,107,110,101,115,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,102, 40,110,
+108, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101,
+ 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48,
+ 46, 48, 41, 59, 10, 10, 9, 9,105,102, 40,100, 97,114,107,110,101,115,115, 32, 60, 61, 32, 49, 46, 48, 41, 10, 9, 9, 9,105,
+115, 32, 61, 32,110,108, 42,112,111,119, 40,109, 97,120, 40,110,118, 42,110,108, 44, 32, 48, 46, 49, 41, 44, 32,100, 97,114,107,
+110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112,
+111,119, 40, 49, 46, 48, 48, 48, 49, 32, 45, 32,110,118, 44, 32,100, 97,114,107,110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59,
+ 10, 9,125, 10,125, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,102, 97, 99, 40,118,101, 99, 51, 32,118,105,
+101,119, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,102,108,111, 97,116, 32,103,114, 97,100, 44, 32,102,108,111, 97,116, 32,102,
+ 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 49, 44, 32,116, 50, 59, 10, 9,102,108,111, 97,116, 32,102,102, 97, 99,
+ 59, 10, 10, 9,105,102, 40,102, 97, 99, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59,
+ 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 49, 61, 32,100,111,116, 40,118,105,101,119, 44, 32,118,110, 41, 59,
+ 10, 9, 9,105,102, 40,116, 49, 62, 48, 46, 48, 41, 32, 32,116, 50, 61, 32, 49, 46, 48, 43,116, 49, 59, 10, 9, 9,101,108,115,
+101, 32,116, 50, 61, 32, 49, 46, 48, 45,116, 49, 59, 10, 10, 9, 9,116, 50, 61, 32,103,114, 97,100, 32, 43, 32, 40, 49, 46, 48,
+ 45,103,114, 97,100, 41, 42,112,111,119, 40,116, 50, 44, 32,102, 97, 99, 41, 59, 10, 10, 9, 9,105,102, 40,116, 50, 60, 48, 46,
+ 48, 41, 32,102,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40,116, 50, 62, 49, 46, 48, 41,
+ 32,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,102,102, 97, 99, 32, 61, 32,116, 50, 59, 10, 9,
+125, 10, 10, 9,114,101,116,117,114,110, 32,102,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,
+105,102,102,117,115,101, 95,102,114,101,115,110,101,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44,
+ 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 95,105, 44, 32,102,108,111, 97,116, 32,102,
+ 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32,102,114,101,115,110,101,
+108, 95,102, 97, 99, 40,108,118, 44, 32,118,110, 44, 32,102, 97, 99, 95,105, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,
+105,100, 32,115,104, 97,100,101, 95, 99,117, 98,105, 99, 40,102,108,111, 97,116, 32,105,115, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,105,115, 41, 10,123, 10, 9,105,102, 40,105,115, 62, 48, 46, 48, 32, 38, 38, 32,105,115, 60, 49, 46, 48,
+ 41, 10, 9, 9,111,117,116,105,115, 61, 32,115,109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,
+105,115, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,105,115, 61, 32,105,115, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,104, 97,100,101, 95,118,105,115,105,102, 97, 99, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,118,105,115,
+105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,114,101,102,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,
+ 41, 10,123, 10, 9, 47, 42,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 42, 47, 10, 9, 9,111,117,116,105, 32, 61, 32,109, 97,
+120, 40,105, 42,118,105,115,105,102, 97, 99, 42,114,101,102,108, 44, 32, 48, 46, 48, 41, 59, 10, 9, 47, 42,101,108,115,101, 10,
+ 9, 9,111,117,116,105, 32, 61, 32,105, 59, 42, 47, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116, 97,110,103,
+101,110,116, 95,118, 95,115,112,101, 99, 40,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,
+110, 41, 10,123, 10, 9,118,110, 32, 61, 32,116, 97,110,103, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,
+100,100, 95,116,111, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,105, 44, 32,118,101, 99, 51, 32,108, 97,109,112,
+ 99,111,108, 44, 32,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,
+123, 10, 9,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,105, 42,108, 97,109,112,
+ 99,111,108, 42, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 48,
+ 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,104,101,109,
+105, 95,115,112,101, 99, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,118,105,
+101,119, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,102,108,111, 97,
+116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,108,118, 32, 43, 61,
+ 32,118,105,101,119, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 10, 9,116, 32,
+ 61, 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10, 9,116, 32, 61, 32, 48, 46, 53, 42,116, 32, 43, 32, 48, 46, 53, 59,
+ 10, 10, 9,116, 32, 61, 32,118,105,115,105,102, 97, 99, 42,115,112,101, 99, 42,112,111,119, 40,116, 44, 32,104, 97,114,100, 41,
+ 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,112,104,111,110,103, 95,115,112,101, 99, 40,118,101, 99, 51, 32,
+110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,
+114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,109, 97,
+120, 40,100,111,116, 40,104, 44, 32,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,112,
+111,119, 40,114,115,108,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 99,111,
+111,107,116,111,114,114, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51,
+ 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97,
+ 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59,
+ 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 10, 9,105,102, 40,110,104, 32,
+ 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,
+115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44,
+ 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,105, 32, 61, 32,112,111,119, 40,110,104, 44, 32,104, 97,114,100, 41,
+ 59, 10, 10, 9, 9,105, 32, 61, 32,105, 47, 40, 48, 46, 49, 43,110,118, 41, 59, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61,
+ 32,105, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 98,108,105,110,110, 95,115,112,101, 99, 40,
+118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,101,
+102,114, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 95,112,111,119,101,114, 44, 32,111,117,116, 32,102,108,111, 97,
+116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,105,102, 40,114,101,102,114, 97, 99, 32, 60, 32, 49, 46, 48, 41, 32,123,
+ 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,115,112,
+101, 99, 95,112,111,119,101,114, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48,
+ 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,115,112,101, 99, 95,112,111,119,101,114, 60, 49,
+ 48, 48, 46, 48, 41, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32,115,113,114,116, 40, 49, 46, 48, 47,115,112,
+101, 99, 95,112,111,119,101,114, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61,
+ 32, 49, 48, 46, 48, 47,115,112,101, 99, 95,112,111,119,101,114, 59, 10, 10, 9, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,
+114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116,
+ 40,110, 44, 32,104, 41, 59, 10, 9, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, 9,115,112,101, 99,
+102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9,102,108,111, 97,116,
+ 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 9, 9, 9,102,
+108,111, 97,116, 32,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9, 9, 9,105,102, 40,110,108, 32, 60, 61,
+ 32, 48, 46, 48, 49, 41, 32,123, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 9,125,
+ 10, 9, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,120, 40,100,111,
+116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97, 32, 61, 32, 49,
+ 46, 48, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 98, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,118, 41, 47,118,104,
+ 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 99, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,108, 41, 47,118,104, 59, 10,
+ 10, 9, 9, 9, 9,102,108,111, 97,116, 32,103, 32, 61, 32, 48, 46, 48, 59, 10, 10, 9, 9, 9, 9,105,102, 40, 97, 32, 60, 32,
+ 98, 32, 38, 38, 32, 97, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 97, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,102, 40, 98,
+ 32, 60, 32, 97, 32, 38, 38, 32, 98, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 98, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,
+102, 40, 99, 32, 60, 32, 97, 32, 38, 38, 32, 99, 32, 60, 32, 98, 41, 32,103, 32, 61, 32, 99, 59, 10, 10, 9, 9, 9, 9,102,108,
+111, 97,116, 32,112, 32, 61, 32,115,113,114,116, 40, 40, 40,114,101,102,114, 97, 99, 32, 42, 32,114,101,102,114, 97, 99, 41, 43,
+ 40,118,104, 42,118,104, 41, 45, 49, 46, 48, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,102, 32, 61, 32, 40, 40, 40,
+112, 45,118,104, 41, 42, 40,112, 45,118,104, 41, 41, 47, 40, 40,112, 43,118,104, 41, 42, 40,112, 43,118,104, 41, 41, 41, 42, 40,
+ 49, 46, 48, 43, 40, 40, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 42, 40, 40,118,104, 42, 40,112, 43,
+118,104, 41, 41, 45, 49, 46, 48, 41, 41, 47, 40, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 42, 40, 40,
+118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 41, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97,110,
+103, 32, 61, 32, 97, 99,111,115, 40,110,104, 41, 59, 10, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,109, 97,120,
+ 40,102, 42,103, 42,101,120,112, 95, 98,108,101,110,100,101,114, 40, 40, 45, 40, 97,110,103, 42, 97,110,103, 41, 47, 40, 50, 46,
+ 48, 42,115,112,101, 99, 95,112,111,119,101,114, 42,115,112,101, 99, 95,112,111,119,101,114, 41, 41, 41, 44, 32, 48, 46, 48, 41,
+ 59, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119, 97,114,100,
+105,115,111, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44,
+ 32,102,108,111, 97,116, 32,114,109,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123,
+ 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,
+111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10,
+ 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 48, 49,
+ 41, 59, 10, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,108, 41, 44, 32, 48, 46,
+ 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103,108,101, 32, 61, 32,116, 97,110, 40, 97, 99,111,115, 40,110,104,
+ 41, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,108,112,104, 97, 32, 61, 32,109, 97,120, 40,114,109,115, 44, 32, 48, 46, 48, 48,
+ 49, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 61, 32,110,108, 32, 42, 32, 40, 49, 46, 48, 47, 40, 52, 46, 48, 42, 77, 95,
+ 80, 73, 42, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 42, 40,101,120,112, 95, 98,108,101,110,100,101,114, 40, 45, 40,
+ 97,110,103,108,101, 42, 97,110,103,108,101, 41, 47, 40, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 47, 40,115,113,114,
+116, 40,110,118, 42,110,108, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116,111,111,110, 95,115,
112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,
-116, 32,114,109,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99,
- 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,110,
-104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,
-116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,
-108,111, 97,116, 32,110,108, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,108, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59,
- 10, 9,102,108,111, 97,116, 32, 97,110,103,108,101, 32, 61, 32,116, 97,110, 40, 97, 99,111,115, 40,110,104, 41, 41, 59, 10, 9,
-102,108,111, 97,116, 32, 97,108,112,104, 97, 32, 61, 32,109, 97,120, 40,114,109,115, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 10,
- 9,115,112,101, 99,102, 97, 99, 61, 32,110,108, 32, 42, 32, 40, 49, 46, 48, 47, 40, 52, 46, 48, 42, 77, 95, 80, 73, 42, 97,108,
-112,104, 97, 42, 97,108,112,104, 97, 41, 41, 42, 40,101,120,112, 95, 98,108,101,110,100,101,114, 40, 45, 40, 97,110,103,108,101,
- 42, 97,110,103,108,101, 41, 47, 40, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 47, 40,115,113,114,116, 40,110,118, 42,
-110,108, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116,111,111,110, 95,115,112,101, 99, 40,118,
-101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,
-101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,
-102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118,
- 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,104, 44, 32,110, 41, 59, 10, 9,102,108,111,
- 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,
-115,105,122,101, 41, 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 97,110,103, 32, 62,
- 61, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,115,109,111,111,116,104, 32, 61, 61,
- 32, 48, 46, 48, 41, 32,114,115,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,114,115,108,116, 32, 61, 32, 49,
- 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41, 59, 10, 10, 9,115,
-112,101, 99,102, 97, 99, 32, 61, 32,114,115,108,116, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101,
- 99, 95, 97,114,101, 97, 95,105,110,112, 40,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 44, 32,102,108,111, 97,116, 32,
-105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,111,117,
-116,115,112,101, 99,102, 97, 99, 32, 61, 32,115,112,101, 99,102, 97, 99, 42,105,110,112, 59, 10,125, 10, 10,118,111,105,100, 32,
-115,104, 97,100,101, 95,115,112,101, 99, 95,116, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,102,108,111, 97,
-116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101,
- 99,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,116, 32, 61, 32,115,104, 97,100,102, 97,
- 99, 42,115,112,101, 99, 42,118,105,115,105,102, 97, 99, 42,115,112,101, 99,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,
-115,104, 97,100,101, 95, 97,100,100, 95,115,112,101, 99, 40,102,108,111, 97,116, 32,116, 44, 32,118,101, 99, 51, 32,108, 97,109,
-112, 99,111,108, 44, 32,118,101, 99, 51, 32,115,112,101, 99, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,
- 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,116, 42,108, 97,109,112, 99,111,108, 42,115,112,101, 99, 99,
-111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44,
+116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,
+108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,104, 44, 32,110, 41, 59,
+ 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,105,102, 40, 97,
+110,103, 32, 60, 32,115,105,122,101, 41, 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,
+ 97,110,103, 32, 62, 61, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,115,109,111,111,
+116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,115,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,114,115,108,
+116, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41,
+ 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,114,115,108,116, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,
+101, 95,115,112,101, 99, 95, 97,114,101, 97, 95,105,110,112, 40,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 44, 32,102,
+108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,112,101, 99,102, 97, 99, 41, 10,
+123, 10, 9,111,117,116,115,112,101, 99,102, 97, 99, 32, 61, 32,115,112,101, 99,102, 97, 99, 42,105,110,112, 59, 10,125, 10, 10,
+118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101, 99, 95,116, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44,
+ 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,102,108,111, 97,
+116, 32,115,112,101, 99,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,116, 32, 61, 32,115,
+104, 97,100,102, 97, 99, 42,115,112,101, 99, 42,118,105,115,105,102, 97, 99, 42,115,112,101, 99,102, 97, 99, 59, 10,125, 10, 10,
+118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,115,112,101, 99, 40,102,108,111, 97,116, 32,116, 44, 32,118,101, 99,
+ 51, 32,108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32,115,112,101, 99, 99,111,108, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,116, 42,108, 97,109,112, 99,111,108, 42,
+115,112,101, 99, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 40,118,101, 99, 52, 32,
+ 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108,
+ 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 59, 10,125, 10, 10,118,111,
+105,100, 32,115,104, 97,100,101, 95,109, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,111,108,
+ 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123,
+ 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,
+111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44,
32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,
-111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104,
- 97,100,101, 95,109, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101,
- 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116,
- 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,
-104, 97,100,101, 95, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52,
- 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,
-108, 32, 61, 32, 99,111,108, 49, 32, 43, 32,109, 97,120, 40, 99,111,108, 50, 44, 32,118,101, 99, 52, 40, 48, 46, 48, 44, 32, 48,
- 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,
-100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,
-118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,
-117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,109, 97,120, 40, 99,111,108, 49, 42, 99,111,108, 50, 44, 32,118,101, 99,
- 52, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
-115,104, 97,100,101, 95,109, 97,100,100,102, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 44, 32,118,
-101, 99, 52, 32, 99,111,108, 49, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,
-116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,102, 42, 99,111,108, 49, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
-100,101, 95,109,117,108, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116,
- 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 42, 99,
-111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 95,118, 97,108,117,101, 40,102,108,111,
- 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
-108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 42,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,
-115,104, 97,100,101, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,
-111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61,
- 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 42,111, 98, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 41, 59,
- 10,125, 10, 10,118,111,105,100, 32,114, 97,109,112, 95,114,103, 98,116,111, 98,119, 40,118,101, 99, 51, 32, 99,111,108,111,114,
- 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,
- 99,111,108,111,114, 46,114, 42, 48, 46, 51, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 53, 56, 32, 43, 32, 99,111,108,
-111,114, 46, 98, 42, 48, 46, 49, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,108,121, 95,115,104,
- 97,100,111,119, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,102,108,111,
- 97,116, 32,101,110,101,114,103,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,104, 97,100,102, 97, 99, 41,
- 10,123, 10, 9,111,117,116,115,104, 97,100,102, 97, 99, 32, 61, 32,105, 42,101,110,101,114,103,121, 42, 40, 49, 46, 48, 32, 45,
- 32,115,104, 97,100,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,108,121, 95,115,104,
- 97,100,111,119, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,118,101, 99, 51,
- 32,114,103, 98, 44, 32,118,101, 99, 52, 32,100,105,102,102, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,100,105,102,
-102, 41, 10,123, 10, 9,111,117,116,100,105,102,102, 32, 61, 32,100,105,102,102, 32, 45, 32,118,101, 99, 52, 40,114,103, 98, 42,
-115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,108,
-121, 95,115,104, 97,100,111,119, 95,115,112,101, 99,117,108, 97,114, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44,
- 32,118,101, 99, 51, 32,115,112,101, 99,114,103, 98, 44, 32,118,101, 99, 52, 32,115,112,101, 99, 44, 32,111,117,116, 32,118,101,
- 99, 52, 32,111,117,116,115,112,101, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99, 32, 61, 32,115,112,101, 99, 32, 45, 32,
-118,101, 99, 52, 40,115,112,101, 99,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,
-111,105,100, 32,116,101,115,116, 95,115,104, 97,100,111,119, 98,117,102, 40,118,101, 99, 51, 32,114, 99,111, 44, 32,115, 97,109,
-112,108,101,114, 50, 68, 83,104, 97,100,111,119, 32,115,104, 97,100,111,119,109, 97,112, 44, 32,109, 97,116, 52, 32,115,104, 97,
-100,111,119,112,101,114,115,109, 97,116, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,111,119, 98,105, 97,115, 44, 32,102,108,
-111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,105,102,
- 40,105,110,112, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,
-125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,118,101, 99, 52, 32, 99,111, 32, 61, 32,115,104, 97,100,111,119,112,101,114,115,
-109, 97,116, 42,118,101, 99, 52, 40,114, 99,111, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9, 9, 47, 47,102,108,111, 97,116, 32, 98,
-105, 97,115, 32, 61, 32, 40, 49, 46, 53, 32, 45, 32,105,110,112, 42,105,110,112, 41, 42,115,104, 97,100,111,119, 98,105, 97,115,
- 59, 10, 9, 9, 99,111, 46,122, 32, 45, 61, 32,115,104, 97,100,111,119, 98,105, 97,115, 42, 99,111, 46,119, 59, 10, 10, 9, 9,
-114,101,115,117,108,116, 32, 61, 32,115,104, 97,100,111,119, 50, 68, 80,114,111,106, 40,115,104, 97,100,111,119,109, 97,112, 44,
- 32, 99,111, 41, 46,120, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,101,120,112,111,115,117,114,
-101, 95, 99,111,114,114,101, 99,116, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32,108,105,110,102, 97, 99,
- 44, 32,102,108,111, 97,116, 32,108,111,103,102, 97, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41,
- 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,108,105,110,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32,101,120,112, 40, 99,
-111,108, 42,108,111,103,102, 97, 99, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,105,115,116, 95,
-102, 97, 99,116,111,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,109,105,115,116,115,116, 97, 44, 32,102,
-108,111, 97,116, 32,109,105,115,116,100,105,115,116, 44, 32,102,108,111, 97,116, 32,109,105,115,116,116,121,112,101, 44, 32,102,
-108,111, 97,116, 32,109,105,115,105, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,
-102,108,111, 97,116, 32,102, 97, 99, 44, 32,122, 99,111,114, 59, 10, 10, 9,122, 99,111,114, 32, 61, 32, 40,103,108, 95, 80,114,
-111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,108,101,
-110,103,116,104, 40, 99,111, 41, 58, 32, 45, 99,111, 91, 50, 93, 59, 10, 9, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112,
- 40, 40,122, 99,111,114, 45,109,105,115,116,115,116, 97, 41, 47,109,105,115,116,100,105,115,116, 44, 32, 48, 46, 48, 44, 32, 49,
- 46, 48, 41, 59, 10, 9,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, 48, 46, 48, 41, 32,102, 97, 99, 32, 42, 61,
- 32,102, 97, 99, 59, 10, 9,101,108,115,101, 32,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, 49, 46, 48, 41, 59,
- 10, 9,101,108,115,101, 32,102, 97, 99, 32, 61, 32,115,113,114,116, 40,102, 97, 99, 41, 59, 10, 10, 9,111,117,116,102, 97, 99,
- 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 45,102, 97, 99, 41, 42, 40, 49, 46, 48, 45,109,105,115,105, 41, 59, 10,125,
- 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119,111,114,108,100, 95,109,105,120, 40,118,101, 99, 51, 32,104,111,114, 44,
- 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,
-108,111, 97,116, 32,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, 99,111,108, 46, 97, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48,
- 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,109,105,120, 40,104,111,114, 44, 32, 99,111,108, 46,114,
-103, 98, 44, 32,102, 97, 99, 41, 44, 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,
- 97,108,112,104, 97, 95,111,112, 97,113,117,101, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
-111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98,
- 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,108,112,104, 97, 95,111, 98, 99,111,
-108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101,
- 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,
-114,103, 98, 44, 32, 99,111,108, 46, 97, 42,111, 98, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 85, 84, 73, 76, 73, 84, 73, 69, 83, 32, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,100,105,101,108,101, 99,116,
-114,105, 99, 40,118,101, 99, 51, 32, 73,110, 99,111,109,105,110,103, 44, 32,118,101, 99, 51, 32, 78,111,114,109, 97,108, 44, 32,
-102,108,111, 97,116, 32,101,116, 97, 41, 10,123, 10, 32, 32, 32, 32, 47, 42, 32, 99,111,109,112,117,116,101, 32,102,114,101,115,
-110,101,108, 32,114,101,102,108,101, 99,116, 97,110, 99,101, 32,119,105,116,104,111,117,116, 32,101,120,112,108,105, 99,105,116,
-108,121, 32, 99,111,109,112,117,116,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32,116,104,101, 32,114,101,102,114, 97, 99,116,101,
-100, 32,100,105,114,101, 99,116,105,111,110, 32, 42, 47, 10, 32, 32, 32, 32,102,108,111, 97,116, 32, 99, 32, 61, 32, 97, 98,115,
- 40,100,111,116, 40, 73,110, 99,111,109,105,110,103, 44, 32, 78,111,114,109, 97,108, 41, 41, 59, 10, 32, 32, 32, 32,102,108,111,
- 97,116, 32,103, 32, 61, 32,101,116, 97, 32, 42, 32,101,116, 97, 32, 45, 32, 49, 46, 48, 32, 43, 32, 99, 32, 42, 32, 99, 59, 10,
- 32, 32, 32, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 59, 10, 10, 32, 32, 32, 32,105,102, 40,103, 32, 62, 32, 48, 46,
- 48, 41, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, 32, 61, 32,115,113,114,116, 40,103, 41, 59, 10, 32, 32, 32, 32, 32, 32,
- 32, 32,102,108,111, 97,116, 32, 65, 32, 61, 40,103, 32, 45, 32, 99, 41, 47, 40,103, 32, 43, 32, 99, 41, 59, 10, 32, 32, 32, 32,
- 32, 32, 32, 32,102,108,111, 97,116, 32, 66, 32, 61, 40, 99, 32, 42, 40,103, 32, 43, 32, 99, 41, 45, 32, 49, 46, 48, 41, 47, 40,
- 99, 32, 42, 40,103, 32, 45, 32, 99, 41, 43, 32, 49, 46, 48, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108,116,
- 32, 61, 32, 48, 46, 53, 32, 42, 32, 65, 32, 42, 32, 65, 32, 42, 40, 49, 46, 48, 32, 43, 32, 66, 32, 42, 32, 66, 41, 59, 10, 32,
- 32, 32, 32,125, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108,116, 32, 61, 32, 49,
- 46, 48, 59, 32, 32, 47, 42, 32, 84, 73, 82, 32, 40,110,111, 32,114,101,102,114, 97, 99,116,101,100, 32, 99,111,109,112,111,110,
-101,110,116, 41, 32, 42, 47, 10, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108,116, 59, 10,125, 10, 10,102,
-108,111, 97,116, 32,104,121,112,111,116, 40,102,108,111, 97,116, 32,120, 44, 32,102,108,111, 97,116, 32,121, 41, 10,123, 10, 9,
-114,101,116,117,114,110, 32,115,113,114,116, 40,120, 42,120, 32, 43, 32,121, 42,121, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10, 35,100,101,102,105,110,101, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 32, 51, 10,
- 10, 47, 42, 32, 98,115,100,102,115, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,
-102,117,115,101, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99,
- 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, 42, 47,
- 10, 9,118,101, 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,
-116,105,111,110, 97,108, 32,108,105,103,104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59,
- 32,105, 32, 60, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,
-105,103,104,116, 95,112,111,115,105,116,105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105,
- 93, 46,112,111,115,105,116,105,111,110, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,100,105,102,
-102,117,115,101, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,100,105,102,102,117,115,101,
- 46,114,103, 98, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 78, 44,
- 32,108,105,103,104,116, 95,112,111,115,105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,
-105,103,104,116, 95,100,105,102,102,117,115,101, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61,
- 32,118,101, 99, 52, 40, 76, 42, 99,111,108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100,
- 32,110,111,100,101, 95, 98,115,100,102, 95,103,108,111,115,115,121, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,
-111, 97,116, 32,114,111,117,103,104,110,101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,
-117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,118,101, 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51,
- 40, 48, 46, 48, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,116,105,111,110, 97,108, 32,108,105,103,104,116,115, 32, 42,
- 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83,
- 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32, 72, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114,
- 99,101, 91,105, 93, 46,104, 97,108,102, 86,101, 99,116,111,114, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,
-104,116, 95,115,112,101, 99,117,108, 97,114, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,
-115,112,101, 99,117,108, 97,114, 46,114,103, 98, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, 61, 32,112,111,
-119, 40,109, 97,120, 40,100,111,116, 40, 78, 44, 32, 72, 41, 44, 32, 48, 46, 48, 41, 44, 32, 49, 46, 48, 47,114,111,117,103,104,
-110,101,115,115, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95,115,112,101, 99,117,108, 97,114, 42, 98,115,100,
-102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61, 32,118,101, 99, 52, 40, 76, 42, 99,111,108,111,114, 46,114,103,
- 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95, 97,110,105,115,111,
-116,114,111,112,105, 99, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,
-115,115, 85, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 86, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,
-101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95,
- 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,
-125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,103,108, 97,115,115, 40,118,101, 99, 52, 32, 99,111,108,
-111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 44, 32,102,108,111, 97,116, 32,105,111,114, 44, 32,
-118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41,
- 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 78, 44, 32,
-114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,116,114, 97,110,115,
-108,117, 99,101,110,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,
-101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101,
- 40, 99,111,108,111,114, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101,
- 95, 98,115,100,102, 95,116,114, 97,110,115,112, 97,114,101,110,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,
-116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32,116,104,105,115, 32,105,115,110, 39,116, 32,
-114,105,103,104,116, 32, 42, 47, 10, 9,114,101,115,117,108,116, 46,114, 32, 61, 32, 99,111,108,111,114, 46,114, 59, 10, 9,114,
-101,115,117,108,116, 46,103, 32, 61, 32, 99,111,108,111,114, 46,103, 59, 10, 9,114,101,115,117,108,116, 46, 98, 32, 61, 32, 99,
-111,108,111,114, 46, 98, 59, 10, 9,114,101,115,117,108,116, 46, 97, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100,
- 32,110,111,100,101, 95, 98,115,100,102, 95,118,101,108,118,101,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,
-111, 97,116, 32,115,105,103,109, 97, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,
+111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32,109, 97,120, 40, 99,111,108, 50, 44, 32,118,101, 99, 52, 40, 48,
+ 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,109, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,
+111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41,
+ 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,109, 97,120, 40, 99,111,108, 49, 42, 99,111,108, 50,
+ 44, 32,118,101, 99, 52, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,
+118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100,102, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116,
+ 32,102, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,
+123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,102, 42, 99,111,108, 49, 59, 10,125, 10, 10,118,111,105,
+100, 32,115,104, 97,100,101, 95,109,117,108, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,
+111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 95,118, 97,108,117,
+101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,
+111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 42,102, 97, 99, 59, 10,125, 10, 10,
+118,111,105,100, 32,115,104, 97,100,101, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99,
+ 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116,
+ 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 42,111, 98, 99,111,108, 46,114,103, 98, 44, 32, 99,111,
+108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,114, 97,109,112, 95,114,103, 98,116,111, 98,119, 40,118,101, 99, 51, 32,
+ 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,
+ 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 53, 56, 32,
+ 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 49, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,
+108,121, 95,115,104, 97,100,111,119, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99,
+ 44, 32,102,108,111, 97,116, 32,101,110,101,114,103,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,104, 97,
+100,102, 97, 99, 41, 10,123, 10, 9,111,117,116,115,104, 97,100,102, 97, 99, 32, 61, 32,105, 42,101,110,101,114,103,121, 42, 40,
+ 49, 46, 48, 32, 45, 32,115,104, 97,100,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,
+108,121, 95,115,104, 97,100,111,119, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44,
+ 32,118,101, 99, 51, 32,114,103, 98, 44, 32,118,101, 99, 52, 32,100,105,102,102, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,
+117,116,100,105,102,102, 41, 10,123, 10, 9,111,117,116,100,105,102,102, 32, 61, 32,100,105,102,102, 32, 45, 32,118,101, 99, 52,
+ 40,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,
+101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,115,112,101, 99,117,108, 97,114, 40,102,108,111, 97,116, 32,115,104, 97,
+100,102, 97, 99, 44, 32,118,101, 99, 51, 32,115,112,101, 99,114,103, 98, 44, 32,118,101, 99, 52, 32,115,112,101, 99, 44, 32,111,
+117,116, 32,118,101, 99, 52, 32,111,117,116,115,112,101, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99, 32, 61, 32,115,112,
+101, 99, 32, 45, 32,118,101, 99, 52, 40,115,112,101, 99,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,116,101,115,116, 95,115,104, 97,100,111,119, 98,117,102, 40,118,101, 99, 51, 32,114, 99,111,
+ 44, 32,115, 97,109,112,108,101,114, 50, 68, 83,104, 97,100,111,119, 32,115,104, 97,100,111,119,109, 97,112, 44, 32,109, 97,116,
+ 52, 32,115,104, 97,100,111,119,112,101,114,115,109, 97,116, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,111,119, 98,105, 97,
+115, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 41, 10,
+123, 10, 9,105,102, 40,105,110,112, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32, 48,
+ 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,118,101, 99, 52, 32, 99,111, 32, 61, 32,115,104, 97,100,111,
+119,112,101,114,115,109, 97,116, 42,118,101, 99, 52, 40,114, 99,111, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9, 9, 47, 47,102,108,
+111, 97,116, 32, 98,105, 97,115, 32, 61, 32, 40, 49, 46, 53, 32, 45, 32,105,110,112, 42,105,110,112, 41, 42,115,104, 97,100,111,
+119, 98,105, 97,115, 59, 10, 9, 9, 99,111, 46,122, 32, 45, 61, 32,115,104, 97,100,111,119, 98,105, 97,115, 42, 99,111, 46,119,
+ 59, 10, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32,115,104, 97,100,111,119, 50, 68, 80,114,111,106, 40,115,104, 97,100,111,
+119,109, 97,112, 44, 32, 99,111, 41, 46,120, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,101,120,
+112,111,115,117,114,101, 95, 99,111,114,114,101, 99,116, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32,108,
+105,110,102, 97, 99, 44, 32,102,108,111, 97,116, 32,108,111,103,102, 97, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,
+116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,108,105,110,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32,
+101,120,112, 40, 99,111,108, 42,108,111,103,102, 97, 99, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,
+109,105,115,116, 95,102, 97, 99,116,111,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,109,105,115,116,115,
+116, 97, 44, 32,102,108,111, 97,116, 32,109,105,115,116,100,105,115,116, 44, 32,102,108,111, 97,116, 32,109,105,115,116,116,121,
+112,101, 44, 32,102,108,111, 97,116, 32,109,105,115,105, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99,
+ 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 44, 32,122, 99,111,114, 59, 10, 10, 9,122, 99,111,114, 32, 61, 32, 40,
+103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48,
+ 41, 63, 32,108,101,110,103,116,104, 40, 99,111, 41, 58, 32, 45, 99,111, 91, 50, 93, 59, 10, 9, 10, 9,102, 97, 99, 32, 61, 32,
+ 99,108, 97,109,112, 40, 40,122, 99,111,114, 45,109,105,115,116,115,116, 97, 41, 47,109,105,115,116,100,105,115,116, 44, 32, 48,
+ 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, 48, 46, 48, 41, 32,102,
+ 97, 99, 32, 42, 61, 32,102, 97, 99, 59, 10, 9,101,108,115,101, 32,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32,
+ 49, 46, 48, 41, 59, 10, 9,101,108,115,101, 32,102, 97, 99, 32, 61, 32,115,113,114,116, 40,102, 97, 99, 41, 59, 10, 10, 9,111,
+117,116,102, 97, 99, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 45,102, 97, 99, 41, 42, 40, 49, 46, 48, 45,109,105,115,
+105, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119,111,114,108,100, 95,109,105,120, 40,118,101, 99, 51,
+ 32,104,111,114, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41,
+ 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, 99,111,108, 46, 97, 44, 32, 48, 46, 48,
+ 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,109,105,120, 40,104,111,114, 44, 32,
+ 99,111,108, 46,114,103, 98, 44, 32,102, 97, 99, 41, 44, 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,
+104, 97,100,101, 95, 97,108,112,104, 97, 95,111,112, 97,113,117,101, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,
+118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,
+108, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,108,112,104, 97,
+ 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111,
+117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52,
+ 40, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 42,111, 98, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10, 47, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 85, 84, 73, 76, 73, 84, 73, 69, 83, 32, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,100,105,
+101,108,101, 99,116,114,105, 99, 40,118,101, 99, 51, 32, 73,110, 99,111,109,105,110,103, 44, 32,118,101, 99, 51, 32, 78,111,114,
+109, 97,108, 44, 32,102,108,111, 97,116, 32,101,116, 97, 41, 10,123, 10, 32, 32, 32, 32, 47, 42, 32, 99,111,109,112,117,116,101,
+ 32,102,114,101,115,110,101,108, 32,114,101,102,108,101, 99,116, 97,110, 99,101, 32,119,105,116,104,111,117,116, 32,101,120,112,
+108,105, 99,105,116,108,121, 32, 99,111,109,112,117,116,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32,116,104,101, 32,114,101,102,
+114, 97, 99,116,101,100, 32,100,105,114,101, 99,116,105,111,110, 32, 42, 47, 10, 32, 32, 32, 32,102,108,111, 97,116, 32, 99, 32,
+ 61, 32, 97, 98,115, 40,100,111,116, 40, 73,110, 99,111,109,105,110,103, 44, 32, 78,111,114,109, 97,108, 41, 41, 59, 10, 32, 32,
+ 32, 32,102,108,111, 97,116, 32,103, 32, 61, 32,101,116, 97, 32, 42, 32,101,116, 97, 32, 45, 32, 49, 46, 48, 32, 43, 32, 99, 32,
+ 42, 32, 99, 59, 10, 32, 32, 32, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 59, 10, 10, 32, 32, 32, 32,105,102, 40,103,
+ 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, 32, 61, 32,115,113,114,116, 40,103, 41, 59, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 65, 32, 61, 40,103, 32, 45, 32, 99, 41, 47, 40,103, 32, 43, 32, 99, 41, 59,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 66, 32, 61, 40, 99, 32, 42, 40,103, 32, 43, 32, 99, 41, 45, 32, 49,
+ 46, 48, 41, 47, 40, 99, 32, 42, 40,103, 32, 45, 32, 99, 41, 43, 32, 49, 46, 48, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,
+101,115,117,108,116, 32, 61, 32, 48, 46, 53, 32, 42, 32, 65, 32, 42, 32, 65, 32, 42, 40, 49, 46, 48, 32, 43, 32, 66, 32, 42, 32,
+ 66, 41, 59, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108,
+116, 32, 61, 32, 49, 46, 48, 59, 32, 32, 47, 42, 32, 84, 73, 82, 32, 40,110,111, 32,114,101,102,114, 97, 99,116,101,100, 32, 99,
+111,109,112,111,110,101,110,116, 41, 32, 42, 47, 10, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108,116, 59,
+ 10,125, 10, 10,102,108,111, 97,116, 32,104,121,112,111,116, 40,102,108,111, 97,116, 32,120, 44, 32,102,108,111, 97,116, 32,121,
+ 41, 10,123, 10, 9,114,101,116,117,114,110, 32,115,113,114,116, 40,120, 42,120, 32, 43, 32,121, 42,121, 41, 59, 10,125, 10, 10,
+ 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10, 35,100,101,102,105,110,101, 32, 78, 85, 77, 95, 76, 73, 71, 72,
+ 84, 83, 32, 51, 10, 10, 47, 42, 32, 98,115,100,102,115, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,
+102, 95,100,105,102,102,117,115,101, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,
+104,110,101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,
+123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, 42, 47, 10, 9,118,101, 99, 51, 32, 76, 32, 61,
+ 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,116,105,111,110, 97,108, 32,108,105,103,
+104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60, 32, 78, 85, 77, 95, 76,
+ 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,112,111,115,105,116,
+105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,112,111,115,105,116,105,111,110,
+ 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,100,105,102,102,117,115,101, 32, 61, 32,103,108, 95,
+ 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,100,105,102,102,117,115,101, 46,114,103, 98, 59, 10, 10, 9, 9,102,
+108,111, 97,116, 32, 98,115,100,102, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 78, 44, 32,108,105,103,104,116, 95,112,111,115,
+105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95,100,105,102,102,117,
+115,101, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61, 32,118,101, 99, 52, 40, 76, 42, 99,111,
+108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102,
+ 95,103,108,111,115,115,121, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,
+101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,
+115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, 42, 47, 10, 9,118,101,
+ 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,116,105,111,110,
+ 97,108, 32,108,105,103,104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60,
+ 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116,
+ 95,112,111,115,105,116,105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,112,111,
+115,105,116,105,111,110, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32, 72, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,
+111,117,114, 99,101, 91,105, 93, 46,104, 97,108,102, 86,101, 99,116,111,114, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,
+108,105,103,104,116, 95,100,105,102,102,117,115,101, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105,
+ 93, 46,100,105,102,102,117,115,101, 46,114,103, 98, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,115,112,101, 99,
+117,108, 97,114, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,115,112,101, 99,117,108, 97,
+114, 46,114,103, 98, 59, 10, 10, 9, 9, 47, 42, 32,119,101, 32,109,105,120, 32,105,110, 32,115,111,109,101, 32,100,105,102,102,
+117,115,101, 32,115,111, 32,108,111,119, 32,114,111,117,103,104,110,101,115,115, 32,115,116,105,108,108, 32,115,104,111,119,115,
+ 32,117,112, 32, 42, 47, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, 61, 32, 48, 46, 53, 42,112,111,119, 40,109, 97,
+120, 40,100,111,116, 40, 78, 44, 32, 72, 41, 44, 32, 48, 46, 48, 41, 44, 32, 49, 46, 48, 47,114,111,117,103,104,110,101,115,115,
+ 41, 59, 10, 9, 9, 98,115,100,102, 32, 43, 61, 32, 48, 46, 53, 42,109, 97,120, 40,100,111,116, 40, 78, 44, 32,108,105,103,104,
+116, 95,112,111,115,105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95,
+115,112,101, 99,117,108, 97,114, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61, 32,118,101, 99,
+ 52, 40, 76, 42, 99,111,108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,
+101, 95, 98,115,100,102, 95, 97,110,105,115,111,116,114,111,112,105, 99, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,
+108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 85, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115,
+ 86, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,
108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32,
+ 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,
+100,102, 95,103,108, 97,115,115, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,
+110,101,115,115, 44, 32,102,108,111, 97,116, 32,105,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44,
+ 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,
+105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125,
+ 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,116,114, 97,110,115,108,117, 99,101,110,116, 40,118,101, 99,
+ 52, 32, 99,111,108,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116,
+ 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46,
+ 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102,
+ 95,116,114, 97,110,115,112, 97,114,101,110,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99,
+ 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32,116,104,105,115, 32,105,115,110, 39,116, 32,114,105,103,104,116,
+ 32, 42, 47, 10, 9,114,101,115,117,108,116, 46,114, 32, 61, 32, 99,111,108,111,114, 46,114, 59, 10, 9,114,101,115,117,108,116,
+ 46,103, 32, 61, 32, 99,111,108,111,114, 46,103, 59, 10, 9,114,101,115,117,108,116, 46, 98, 32, 61, 32, 99,111,108,111,114, 46,
+ 98, 59, 10, 9,114,101,115,117,108,116, 46, 97, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101,
+ 95, 98,115,100,102, 95,118,101,108,118,101,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,115,
+105,103,109, 97, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123,
+ 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32,
78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10, 47, 42, 32,101,109,105,115,115,105,111,110, 32, 42, 47, 10, 10,118,
111,105,100, 32,110,111,100,101, 95,101,109,105,115,115,105,111,110, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,
111, 97,116, 32,115,116,114,101,110,103,116,104, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index 7159c09d703..eb3695ea217 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -62,8 +62,8 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
PoseTarget *target;
bConstraint *con;
bKinematicConstraint *data;
- int a, segcount= 0, size, newsize, *oldparent, parent;
-
+ 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) {
@@ -114,7 +114,7 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
if(tree==NULL) {
/* make new tree */
tree= MEM_callocN(sizeof(PoseTree), "posetree");
-
+
tree->type= CONSTRAINT_TYPE_KINEMATIC;
tree->iterations= data->iterations;
@@ -138,13 +138,27 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
/* skip common pose channels and add remaining*/
size= MIN2(segcount, tree->totchannel);
- for(a=0; a<size && tree->pchan[a]==chanlist[segcount-a-1]; a++);
- parent= a-1;
+ a = t = 0;
+ while (a<size && t<tree->totchannel) {
+ // locate first matching channel
+ 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++);
+ }
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)
+ break;
+
+ /* shouldn't happen, but could with dependency cycles */
+ if(parent == tree->totchannel)
+ parent = a - 1;
+
/* resize array */
newsize= tree->totchannel + segcount;
oldchan= tree->pchan;
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 2cb3a32ae3e..f4720b7fc41 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -326,11 +326,19 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
break;
for(; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++);
}
- parent= a-1;
+
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)
+ break;
+
+ /* shouldn't happen, but could with dependency cycles */
+ if(parent == tree->totchannel)
+ parent = a - 1;
+
/* resize array */
newsize= tree->totchannel + segcount;
oldchan= tree->pchan;
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 5a410a6a583..b627baf99bd 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -173,6 +173,7 @@ struct anim {
AVCodecContext *pCodecCtx;
AVCodec *pCodec;
AVFrame *pFrame;
+ int pFrameComplete;
AVFrame *pFrameRGB;
AVFrame *pFrameDeinterlaced;
struct SwsContext *img_convert_ctx;
@@ -181,7 +182,6 @@ struct anim {
struct ImBuf * last_frame;
int64_t last_pts;
int64_t next_pts;
- int64_t next_undecoded_pts;
AVPacket next_packet;
#endif
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index fb6c85c2408..8928774dcb4 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -504,7 +504,6 @@ static int startffmpeg(struct anim * anim) {
anim->last_frame = 0;
anim->last_pts = -1;
anim->next_pts = -1;
- anim->next_undecoded_pts = -1;
anim->next_packet.stream_index = -1;
anim->pFormatCtx = pFormatCtx;
@@ -513,6 +512,7 @@ static int startffmpeg(struct anim * anim) {
anim->videoStream = videoStream;
anim->pFrame = avcodec_alloc_frame();
+ anim->pFrameComplete = FALSE;
anim->pFrameDeinterlaced = avcodec_alloc_frame();
anim->pFrameRGB = avcodec_alloc_frame();
@@ -602,6 +602,10 @@ static void ffmpeg_postprocess(struct anim * anim)
ibuf->profile = IB_PROFILE_SRGB;
+ if (!anim->pFrameComplete) {
+ return;
+ }
+
/* This means the data wasnt read properly,
this check stops crashing */
if (input->data[0]==0 && input->data[1]==0
@@ -611,6 +615,12 @@ static void ffmpeg_postprocess(struct anim * anim)
return;
}
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ " POSTPROC: anim->pFrame planes: %p %p %p %p\n",
+ input->data[0], input->data[1], input->data[2],
+ input->data[3]);
+
+
if (anim->ib_flags & IB_animdeinterlace) {
if (avpicture_deinterlace(
(AVPicture*)
@@ -648,10 +658,6 @@ static void ffmpeg_postprocess(struct anim * anim)
dst2,
dstStride2);
- /* workaround: sws_scale bug
- sets alpha = 0 and compensate
- for altivec-bugs and flipy... */
-
bottom = (unsigned char*) ibuf->rect;
top = bottom + ibuf->x * (ibuf->y-1) * 4;
@@ -662,17 +668,17 @@ static void ffmpeg_postprocess(struct anim * anim)
unsigned char tmp[4];
unsigned int * tmp_l =
(unsigned int*) tmp;
- tmp[3] = 0xff;
for (x = 0; x < w; x++) {
tmp[0] = bottom[0];
tmp[1] = bottom[1];
tmp[2] = bottom[2];
+ tmp[3] = bottom[3];
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2];
- bottom[3] = 0xff;
+ bottom[3] = top[3];
*(unsigned int*) top = *tmp_l;
@@ -688,7 +694,6 @@ static void ffmpeg_postprocess(struct anim * anim)
uint8_t* dst2[4] = { dst[0] + (anim->y - 1)*dstStride[0],
0, 0, 0 };
int i;
- unsigned char* r;
sws_scale(anim->img_convert_ctx,
(const uint8_t * const *)input->data,
@@ -697,17 +702,6 @@ static void ffmpeg_postprocess(struct anim * anim)
anim->pCodecCtx->height,
dst2,
dstStride2);
-
- r = (unsigned char*) ibuf->rect;
-
- /* workaround sws_scale bug: older version of
- sws_scale set alpha = 0... */
- if (r[3] == 0) {
- for (i = 0; i < ibuf->x * ibuf->y; i++) {
- r[3] = 0xff;
- r += 4;
- }
- }
}
if (filter_y) {
@@ -715,40 +709,15 @@ static void ffmpeg_postprocess(struct anim * anim)
}
}
-/* decode one video frame and load the next packet into anim->packet,
- so that we can obtain next_pts and next undecoded pts */
+/* decode one video frame also considering the packet read into next_packet */
static int ffmpeg_decode_video_frame(struct anim * anim)
{
- int frameFinished = 0;
int rval = 0;
av_log(anim->pFormatCtx, AV_LOG_DEBUG, " DECODE VIDEO FRAME\n");
- anim->next_undecoded_pts = -1;
-
if (anim->next_packet.stream_index == anim->videoStream) {
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
- " DECODE: cached next packet\n");
-
- avcodec_decode_video2(anim->pCodecCtx,
- anim->pFrame, &frameFinished,
- &anim->next_packet);
-
- if (frameFinished) {
- av_log(anim->pFormatCtx,
- AV_LOG_DEBUG,
- " FRAME DONE: "
- "next_pts=%lld pkt_pts=%lld\n",
- (anim->pFrame->pts == AV_NOPTS_VALUE) ?
- -1 : (long long int)anim->pFrame->pts,
- (anim->pFrame->pkt_pts == AV_NOPTS_VALUE) ?
- -1 : (long long int)anim->pFrame->pkt_pts);
- anim->next_pts =
- av_get_pts_from_frame(anim->pFormatCtx,
- anim->pFrame);
- }
-
av_free_packet(&anim->next_packet);
anim->next_packet.stream_index = -1;
}
@@ -769,21 +738,14 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
(anim->next_packet.flags & AV_PKT_FLAG_KEY) ?
" KEY" : "");
if (anim->next_packet.stream_index == anim->videoStream) {
- if (frameFinished) {
- av_log(anim->pFormatCtx,
- AV_LOG_DEBUG,
- " FRAME finished, we leave\n");
- anim->next_undecoded_pts
- = anim->next_packet.dts;
- break;
- }
+ anim->pFrameComplete = 0;
avcodec_decode_video2(
anim->pCodecCtx,
- anim->pFrame, &frameFinished,
+ anim->pFrame, &anim->pFrameComplete,
&anim->next_packet);
- if (frameFinished) {
+ if (anim->pFrameComplete) {
anim->next_pts = av_get_pts_from_frame(
anim->pFormatCtx, anim->pFrame);
@@ -798,16 +760,20 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
-1 : (long long int)anim->pFrame->pkt_pts,
(long long int)anim->next_pts);
}
+ break;
}
av_free_packet(&anim->next_packet);
anim->next_packet.stream_index = -1;
}
if (rval < 0) {
+ anim->next_packet.stream_index = -1;
+
av_log(anim->pFormatCtx,
AV_LOG_ERROR, " DECODE READ FAILED: av_read_frame() "
"returned error: %d\n", rval);
}
+
return (rval >= 0);
}
@@ -870,7 +836,7 @@ static int match_format(const char *name, AVFormatContext * pFormatCtx)
static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx)
{
- static const char * byte_seek_list [] = { "dv", "mpegts", 0 };
+ static const char * byte_seek_list [] = { "mpegts", 0 };
const char ** p;
if (pFormatCtx->iformat->flags & AVFMT_TS_DISCONT) {
@@ -890,7 +856,7 @@ static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx)
static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
IMB_Timecode_Type tc) {
- unsigned long long pts_to_search = 0;
+ int64_t pts_to_search = 0;
double frame_rate;
double pts_time_base;
long long st_time;
@@ -923,7 +889,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
tc_index, new_frame_index);
} else {
pts_to_search = (long long)
- floor(((double) position) / pts_time_base / frame_rate + 0.5);
+ floor(((double) position)
+ / pts_time_base / frame_rate + 0.5);
if (st_time != AV_NOPTS_VALUE) {
pts_to_search += st_time / pts_time_base
@@ -934,35 +901,23 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: looking for PTS=%lld "
"(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n",
- (long long int)pts_to_search, pts_time_base, frame_rate, st_time);
+ (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){
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: frame repeat: last: %lld next: %lld\n",
- (long long int)anim->last_pts, (long long int)anim->next_pts);
+ (long long int)anim->last_pts,
+ (long long int)anim->next_pts);
IMB_refImBuf(anim->last_frame);
anim->curposition = position;
return anim->last_frame;
}
- IMB_freeImBuf(anim->last_frame);
-
- if (anim->next_pts <= pts_to_search &&
- anim->next_undecoded_pts > pts_to_search) {
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
- "FETCH: no seek necessary: "
- "next: %lld next undecoded: %lld\n",
- (long long int)anim->next_pts,
- (long long int)anim->next_undecoded_pts);
-
- /* we are already done :) */
-
- } else if (position > anim->curposition + 1
- && anim->preseek
- && !tc_index
- && position - (anim->curposition + 1) < anim->preseek) {
-
+ if (position > anim->curposition + 1
+ && anim->preseek
+ && !tc_index
+ && position - (anim->curposition + 1) < anim->preseek) {
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: within preseek interval (no index)\n");
@@ -1011,6 +966,11 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
} else {
pos = (long long) (position - anim->preseek)
* AV_TIME_BASE / frame_rate;
+
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ "NO INDEX seek pos = %lld, st_time = %lld\n",
+ pos, (st_time != AV_NOPTS_VALUE) ? st_time : 0);
+
if (pos < 0) {
pos = 0;
}
@@ -1019,6 +979,9 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
pos += st_time;
}
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ "NO INDEX final seek pos = %lld\n", pos);
+
ret = av_seek_frame(anim->pFormatCtx, -1,
pos, AVSEEK_FLAG_BACKWARD);
}
@@ -1048,12 +1011,16 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
} else if (position == 0 && anim->curposition == -1) {
/* first frame without seeking special case... */
ffmpeg_decode_video_frame(anim);
+ } else {
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ "FETCH: no seek necessary, just continue...\n");
}
+ IMB_freeImBuf(anim->last_frame);
anim->last_frame = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect);
ffmpeg_postprocess(anim);
-
+
anim->last_pts = anim->next_pts;
ffmpeg_decode_video_frame(anim);
@@ -1061,7 +1028,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
anim->curposition = position;
IMB_refImBuf(anim->last_frame);
-
+
return anim->last_frame;
}
diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c
index 41169a1c211..b19b88248f4 100644
--- a/source/blender/imbuf/intern/moviecache.c
+++ b/source/blender/imbuf/intern/moviecache.c
@@ -204,9 +204,9 @@ struct MovieCache *IMB_moviecache_create(int keysize, GHashHashFP hashfp, GHashC
MovieCache *cache;
cache= MEM_callocN(sizeof(MovieCache), "MovieCache");
- cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, 0);
- cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, 0);
- cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, 0);
+ 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->keysize= keysize;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 67171c35ca3..234dc125c6e 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -80,6 +80,13 @@ typedef struct IDProperty {
#define IDP_IDPARRAY 9
#define IDP_NUMTYPES 10
+/*->subtype */
+
+/* IDP_STRING */
+#define IDP_STRING_SUB_UTF8 0 /* default */
+#define IDP_STRING_SUB_BYTE 1 /* arbitrary byte array, _not_ null terminated */
+
+
/* add any future new id property types here.*/
/* watch it: Sequence has identical beginning. */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 3620131b8df..c85ef72d337 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -410,7 +410,7 @@ typedef struct bShrinkwrapConstraint {
typedef struct bFollowTrackConstraint {
struct MovieClip *clip;
char track[24];
- int flag, reference;
+ int flag, pad;
} bFollowTrackConstraint;
/* Camera Solver constraints */
@@ -751,14 +751,9 @@ typedef enum ePivotConstraint_Flag {
PIVOTCON_FLAG_ROTACT_NEG = (1<<1)
} ePivotConstraint_Flag;
-/* FollowTrack Constraint -> flag */
-typedef enum eFollowTrack_Reference {
- FOLLOWTRACK_TRACK = (1<<0),
- FOLLOWTRACK_BUNDLE = (1<<1)
-} FollowTrack_Reference;
-
typedef enum eFollowTrack_Flags {
- FOLLOWTRACK_ACTIVECLIP = (1<<0)
+ FOLLOWTRACK_ACTIVECLIP = (1<<0),
+ FOLLOWTRACK_USE_3D_POSITION = (1<<1)
} eFollowTrack_Flags;
/* CameraSolver Constraint -> flag */
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 22a0462985c..fdfd1e2b754 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -169,6 +169,7 @@ typedef struct DynamicPaintCanvasSettings {
#define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */
#define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */
#define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */
+#define MOD_DPAINT_WAVEB_CHANGE 3 /* use change of intersection depth from previous frame */
/* brush ray_dir */
#define MOD_DPAINT_RAY_CANVAS 0
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 20001ea6cb6..ed3d42a9da7 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -73,8 +73,8 @@ typedef enum ModifierType {
eModifierType_WeightVGEdit,
eModifierType_WeightVGMix,
eModifierType_WeightVGProximity,
- eModifierType_EmptySlot, /* keep so DynamicPaint keep loading, can re-use later */
- eModifierType_DynamicPaint, /* reserve slot */
+ eModifierType_Ocean,
+ eModifierType_DynamicPaint,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -750,6 +750,67 @@ typedef struct ScrewModifierData {
#define MOD_SCREW_OBJECT_OFFSET (1<<2)
// #define MOD_SCREW_OBJECT_ANGLE (1<<4)
+typedef struct OceanModifierData {
+ ModifierData modifier;
+
+ struct Ocean *ocean;
+ struct OceanCache *oceancache;
+
+ int resolution;
+ int spatial_size;
+
+ float wind_velocity;
+
+ float damp;
+ float smallest_wave;
+ float depth;
+
+ float wave_alignment;
+ float wave_direction;
+ float wave_scale;
+
+ float chop_amount;
+ float foam_coverage;
+ float time;
+
+ int bakestart;
+ int bakeend;
+
+ char cachepath[240]; // FILE_MAX
+ char foamlayername[32];
+ char cached;
+ char geometry_mode;
+
+ char flag;
+ char refresh;
+
+ short repeat_x;
+ short repeat_y;
+
+ int seed;
+
+ float size;
+
+ float foam_fade;
+
+ int pad;
+
+} OceanModifierData;
+
+#define MOD_OCEAN_GEOM_GENERATE 0
+#define MOD_OCEAN_GEOM_DISPLACE 1
+#define MOD_OCEAN_GEOM_SIM_ONLY 2
+
+#define MOD_OCEAN_REFRESH_RESET 1
+#define MOD_OCEAN_REFRESH_SIM 2
+#define MOD_OCEAN_REFRESH_ADD 4
+#define MOD_OCEAN_REFRESH_CLEAR_CACHE 8
+#define MOD_OCEAN_REFRESH_TOPOLOGY 16
+
+#define MOD_OCEAN_GENERATE_FOAM 1
+#define MOD_OCEAN_GENERATE_NORMALS 2
+
+
typedef struct WarpModifierData {
ModifierData modifier;
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 07c2885eff7..1897f8a0353 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -376,9 +376,10 @@ typedef struct NodeVertexCol {
/* qdn: Defocus blur node */
typedef struct NodeDefocus {
- char bktype, rotation, preview, gamco;
+ char bktype, pad_c1, preview, gamco;
short samples, no_zbuf;
float fstop, maxblur, bthresh, scale;
+ float rotation, pad_f1;
} NodeDefocus;
typedef struct NodeScriptDict {
@@ -389,8 +390,9 @@ typedef struct NodeScriptDict {
/* qdn: glare node */
typedef struct NodeGlare {
char quality, type, iter;
- char angle, angle_ofs, size, pad[2];
+ char angle, pad_c1, size, pad[2];
float colmod, mix, threshold, fade;
+ float angle_ofs, pad_f1;
} NodeGlare;
/* qdn: tonemap node */
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index a32320b1740..fd6f4afd593 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -178,6 +178,11 @@ typedef struct FluidsimSettings {
#define OB_FLUIDSIM_ACTIVE (1 << 1)
#define OB_FLUIDSIM_OVERRIDE_TIME (1 << 2)
+#define OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME "fluidsurface_preview_####.bobj.gz"
+#define OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME "fluidsurface_final_####.bobj.gz"
+#define OB_FLUIDSIM_SURF_FINAL_VEL_FNAME "fluidsurface_final_####.bvel.gz"
+#define OB_FLUIDSIM_SURF_PARTICLES_FNAME "fluidsurface_particles_####.gz"
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index f4736add66c..11a6460b1fc 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -233,7 +233,10 @@ typedef struct ParticleSettings {
struct PartDeflect *pd2;
} ParticleSettings;
-typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in copy_particlesystem */
+typedef struct ParticleSystem
+{ /* note1: make sure all (runtime) are NULL's in 'copy_particlesystem' XXX, this function is no more! - need to invstigate */
+ /* note2: make sure any uses of this struct in DNA are accounted for in 'copy_object_particlesystems' */
+
struct ParticleSystem *next, *prev;
ParticleSettings *part; /* particle settings */
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 1ecca5a0b2a..619df428f7c 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -50,6 +50,7 @@ struct Tex;
struct Image;
struct PreviewImage;
struct ImBuf;
+struct Ocean;
struct CurveMapping;
typedef struct MTex {
@@ -206,6 +207,15 @@ typedef struct VoxelData {
} VoxelData;
+typedef struct OceanTex {
+ struct Object *object;
+ char oceanmod[64];
+
+ int output;
+ int pad;
+
+} OceanTex;
+
typedef struct Tex {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -261,13 +271,14 @@ typedef struct Tex {
struct PreviewImage * preview;
struct PointDensity *pd;
struct VoxelData *vd;
+ struct OceanTex *ot;
char use_nodes;
char pad[7];
} Tex;
-/* used for mapping and texture nodes. note: rot is in degrees */
+/* used for mapping and texture nodes. note: rot is now in radians */
typedef struct TexMapping {
float loc[3], rot[3], size[3];
@@ -318,6 +329,7 @@ typedef struct ColorMapping {
#define TEX_DISTNOISE 13
#define TEX_POINTDENSITY 14
#define TEX_VOXELDATA 15
+#define TEX_OCEAN 16
/* musgrave stype */
#define TEX_MFRACTAL 0
@@ -588,6 +600,18 @@ typedef struct ColorMapping {
#define TEX_VD_SMOKEHEAT 1
#define TEX_VD_SMOKEVEL 2
+/******************** Ocean *****************************/
+/* output */
+#define TEX_OCN_DISPLACEMENT 1
+#define TEX_OCN_FOAM 2
+#define TEX_OCN_JPLUS 3
+#define TEX_OCN_EMINUS 4
+#define TEX_OCN_EPLUS 5
+
+/* flag */
+#define TEX_OCN_GENERATE_NORMALS 1
+#define TEX_OCN_XZ 2
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index b359ea3544d..cbac3721ac3 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -123,6 +123,11 @@ typedef struct MovieTrackingSettings {
/* ** reconstruction settings ** */
int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */
+ /* ** which camera intrinsics to refine. uses on the REFINE_* flags */
+ short refine_camera_intrinsics;
+
+ char pad2[6];
+
/* ** tool settings ** */
/* set scale */
@@ -203,9 +208,16 @@ enum {
#define TRACKING_SPEED_QUARTER 4
#define TRACKING_SPEED_DOUBLE 5
+/* MovieTrackingSettings->refine_camera_intrinsics */
+#define REFINE_FOCAL_LENGTH (1<<0)
+#define REFINE_PRINCIPAL_POINT (1<<1)
+#define REFINE_RADIAL_DISTORTION_K1 (1<<2)
+#define REFINE_RADIAL_DISTORTION_K2 (1<<4)
+
/* MovieTrackingStrabilization->flag */
#define TRACKING_2D_STABILIZATION (1<<0)
#define TRACKING_AUTOSCALE (1<<1)
+#define TRACKING_STABILIZE_ROTATION (1<<2)
/* MovieTrackingReconstruction->flag */
#define TRACKING_RECONSTRUCTED (1<<0)
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 5da1e2f4013..0413358bee4 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -112,9 +112,8 @@ typedef struct uiStyle {
short buttonspacex;
short buttonspacey;
short panelspace;
- short panelouter;
- short pad[1];
+ short pad[2];
} uiStyle;
typedef struct uiWidgetColors {
@@ -139,6 +138,12 @@ typedef struct uiWidgetStateColors {
float blend, pad;
} uiWidgetStateColors;
+typedef struct uiPanelColors {
+ char header[4];
+ short show_header;
+ short pad;
+} uiPanelColors;
+
typedef struct ThemeUI {
/* Interface Elements (buttons, menus, icons) */
@@ -149,9 +154,13 @@ typedef struct ThemeUI {
uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item;
uiWidgetStateColors wcol_state;
-
+
+ uiPanelColors panel;
+
char iconfile[80]; // FILE_MAXFILE length
-
+ float icon_alpha;
+
+ float pad;
} ThemeUI;
/* try to put them all in one, if needed a special struct can be created as well
@@ -606,7 +615,6 @@ extern UserDef U; /* from blenkernel blender.c */
*/
/* actually... users probably don't care about what the mode
is called, just that it feels right */
-#define NDOF_ORBIT_INVERT_AXES (1 << 6)
/* zoom is up/down if this flag is set (otherwise forward/backward) */
#define NDOF_ZOOM_UPDOWN (1 << 7)
#define NDOF_ZOOM_INVERT (1 << 8)
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 781fe805812..8e9bc7c50f0 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -64,7 +64,7 @@
/* Included the path relative from /source/blender/ here, so we can move */
/* headers around with more freedom. */
-const char *includefiles[] = {
+static const char *includefiles[] = {
// if you add files here, please add them at the end
// of makesdna.c (this file) as well
@@ -226,7 +226,7 @@ void printStructLenghts(void);
/* ************************* MAKEN DNA ********************** */
-int add_type(const char *str, int len)
+static int add_type(const char *str, int len)
{
int nr;
char *cp;
@@ -401,7 +401,7 @@ static int add_name(const char *str)
return nr_names-1;
}
-short *add_struct(int namecode)
+static short *add_struct(int namecode)
{
int len;
short *sp;
@@ -524,7 +524,7 @@ static void *read_file_data(char *filename, int *len_r)
return data;
}
-int convert_include(char *filename)
+static int convert_include(char *filename)
{
/* read include file, skip structs with a '#' before it.
store all data in temporal arrays.
@@ -661,7 +661,7 @@ int convert_include(char *filename)
return 0;
}
-int arraysize(char *astr, int len)
+static int arraysize(char *astr, int len)
{
int a, mul=1;
char str[100], *cp=NULL;
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index c34f319b0a1..a908833505a 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -381,6 +381,9 @@ extern StructRNA RNA_NorController;
extern StructRNA RNA_Object;
extern StructRNA RNA_ObjectBase;
extern StructRNA RNA_ObstacleFluidSettings;
+extern StructRNA RNA_OceanModifier;
+extern StructRNA RNA_OceanTexData;
+extern StructRNA RNA_OceanTexture;
extern StructRNA RNA_Operator;
extern StructRNA RNA_OperatorFileListElement;
extern StructRNA RNA_OperatorMousePath;
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 6dc7bf2abe3..b7ac5f394b0 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -208,6 +208,9 @@ const char *RNA_property_typename(PropertyType type);
#define IS_DNATYPE_FLOAT_COMPAT(_str) (strcmp(_str, "float") == 0 || strcmp(_str, "double") == 0)
#define IS_DNATYPE_INT_COMPAT(_str) (strcmp(_str, "int") == 0 || strcmp(_str, "short") == 0 || strcmp(_str, "char") == 0)
+/* max size for dynamic defined type descriptors,
+ * this value is arbitrary */
+#define RNA_DYN_DESCR_MAX 240
#ifdef __cplusplus
}
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 1655665efe3..85869115e79 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -108,7 +108,9 @@ typedef enum PropertySubType {
PROP_FILEPATH = 1,
PROP_DIRPATH = 2,
PROP_FILENAME = 3,
- PROP_TRANSLATE = 4, /* a string which should be translated */
+ PROP_BYTESTRING = 4, /* a string which should be represented as bytes
+ * in python, still NULL terminated though. */
+ PROP_TRANSLATE = 5, /* a string which should be translated */
/* numbers */
PROP_UNSIGNED = 13,
@@ -301,13 +303,14 @@ typedef struct ParameterDynAlloc {
typedef enum FunctionFlag {
FUNC_NO_SELF = 1, /* for static functions */
- FUNC_USE_CONTEXT = 2,
- FUNC_USE_REPORTS = 4,
+ FUNC_USE_MAIN = 2,
+ FUNC_USE_CONTEXT = 4,
+ FUNC_USE_REPORTS = 8,
FUNC_USE_SELF_ID = 2048,
/* registering */
- FUNC_REGISTER = 8,
- FUNC_REGISTER_OPTIONAL = 8|16,
+ FUNC_REGISTER = 16,
+ FUNC_REGISTER_OPTIONAL = 16|32,
/* internal flags */
FUNC_BUILTIN = 128,
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index c4b3f204b23..72c2f9a1caf 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -56,6 +56,9 @@ if env['WITH_BF_PYTHON']:
if env['WITH_BF_COLLADA']:
defs.append('WITH_COLLADA')
+if env['WITH_BF_OCEANSIM']:
+ defs.append('WITH_OCEANSIM')
+
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index f61db894263..24db4e80c2b 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -207,6 +207,10 @@ if(WITH_FFTW3)
add_definitions(-DWITH_FFTW3)
endif()
+if(WITH_MOD_OCEANSIM)
+ add_definitions(-DWITH_OCEANSIM)
+endif()
+
if(WITH_SDL)
add_definitions(-DWITH_SDL)
endif()
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index b6ddfe39e9d..e837725a75b 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -524,7 +524,11 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else {
const PropertySubType subtype= prop->subtype;
- const char *string_copy_func= (subtype==PROP_FILEPATH || subtype==PROP_DIRPATH || subtype==PROP_FILENAME) ? "BLI_strncpy" : "BLI_strncpy_utf8";
+ 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)
@@ -739,7 +743,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else {
const PropertySubType subtype= prop->subtype;
- const char *string_copy_func= (subtype==PROP_FILEPATH || subtype==PROP_DIRPATH || subtype==PROP_FILENAME) ? "BLI_strncpy" : "BLI_strncpy_utf8";
+ 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)
@@ -1426,21 +1434,21 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
case PROP_BOOLEAN: {
if(!prop->arraydimension)
fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
- else
+ 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)
fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
- else
+ 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)
fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
- else
+ else if(prop->totarraylength)
fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
@@ -1501,21 +1509,21 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
case PROP_BOOLEAN: {
if(!prop->arraydimension)
fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else
+ 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)
fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else
+ 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)
fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else
+ else if(prop->totarraylength)
fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
@@ -1701,6 +1709,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
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;
@@ -1816,6 +1830,7 @@ static const char *rna_property_subtypename(PropertySubType type)
case PROP_FILEPATH: return "PROP_FILEPATH";
case PROP_FILENAME: return "PROP_FILENAME";
case PROP_DIRPATH: return "PROP_DIRPATH";
+ case PROP_BYTESTRING: return "PROP_BYTESTRING";
case PROP_TRANSLATE: return "PROP_TRANSLATE";
case PROP_UNSIGNED: return "PROP_UNSIGNED";
case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
@@ -1998,6 +2013,12 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
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;
@@ -2473,7 +2494,7 @@ static RNAProcessItem PROCESS_ITEMS[]= {
{"rna_space.c", NULL, RNA_def_space},
{"rna_speaker.c", NULL, RNA_def_speaker},
{"rna_test.c", NULL, RNA_def_test},
- {"rna_text.c", NULL, RNA_def_text},
+ {"rna_text.c", "rna_text_api.c", RNA_def_text},
{"rna_timeline.c", NULL, RNA_def_timeline_marker},
{"rna_sound.c", NULL, RNA_def_sound},
{"rna_ui.c", "rna_ui_api.c", RNA_def_ui},
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 6f9c7a8f19b..d3666e28338 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1617,7 +1617,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier));
+ IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
@@ -1696,7 +1696,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in
group= RNA_struct_idprops(ptr, 1);
if(group) {
- idprop= IDP_New(IDP_ARRAY, val, prop->identifier);
+ idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
}
@@ -1814,7 +1814,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier));
+ IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
@@ -1930,7 +1930,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
group= RNA_struct_idprops(ptr, 1);
if(group) {
- idprop= IDP_New(IDP_ARRAY, val, prop->identifier);
+ idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
}
@@ -2050,7 +2050,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, prop->identifier));
+ IDP_AddToGroup(group, IDP_New(IDP_FLOAT, &val, prop->identifier));
}
}
@@ -2184,7 +2184,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa
group= RNA_struct_idprops(ptr, 1);
if(group) {
- idprop= IDP_New(IDP_ARRAY, val, prop->identifier);
+ idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len);
}
@@ -2271,12 +2271,23 @@ void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- if((idprop=rna_idproperty_check(&prop, ptr)))
- strcpy(value, IDP_String(idprop));
- else if(sprop->get)
+ 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';
+ }
+ else {
+ memcpy(value, IDP_String(idprop), idprop->len);
+ }
+ }
+ else if(sprop->get) {
sprop->get(ptr, value);
- else
+ }
+ else {
strcpy(value, sprop->defaultvalue);
+ }
}
char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop,
@@ -2320,8 +2331,18 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- if((idprop=rna_idproperty_check(&prop, ptr)))
- return strlen(IDP_String(idprop));
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if (idprop->subtype == IDP_STRING_SUB_BYTE) {
+ return idprop->len;
+ }
+ else {
+#ifndef NDEBUG
+ /* these _must_ stay in sync */
+ BLI_assert(strlen(IDP_String(idprop)) == idprop->len - 1);
+#endif
+ return idprop->len - 1;
+ }
+ }
else if(sprop->length)
return sprop->length(ptr);
else
@@ -2336,6 +2357,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
BLI_assert(RNA_property_type(prop) == PROP_STRING);
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);
else if(sprop->set)
sprop->set(ptr, value); /* set function needs to clamp its self */
@@ -2421,7 +2443,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier));
+ IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
@@ -2517,7 +2539,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, prop->identifier));
+ IDP_AddToGroup(group, IDP_New(IDP_GROUP, &val, prop->identifier));
}
else
printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);
@@ -2640,7 +2662,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
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
MEM_freeN(item);
@@ -2654,7 +2676,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
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
MEM_freeN(item);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index db71dee26ce..392aa6a7f5a 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -626,7 +626,7 @@ static void rna_def_action_actuator(BlenderRNA *brna)
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);
@@ -733,37 +733,37 @@ static void rna_def_object_actuator(BlenderRNA *brna)
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", "Set the upper limit for force");
+ 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);
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", "Set the lower limit for force");
+ 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);
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", "Set the upper limit for force");
+ 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);
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", "Set the lower limit for force");
+ 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);
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", "Set the upper limit for force");
+ 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);
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", "Set the lower limit for force");
+ RNA_def_property_ui_text(prop, "Min", "Lower limit for Z force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
@@ -771,42 +771,42 @@ static void rna_def_object_actuator(BlenderRNA *brna)
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", "Sets the location");
+ 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);
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", "Sets the rotation");
+ 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);
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", "Sets the force");
+ 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);
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", "Sets the torque");
+ 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);
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", "Sets the 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);
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);
- RNA_def_property_ui_text(prop, "Angular Velocity", "Sets the angular velocity");
+ RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
@@ -902,14 +902,14 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
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);
- RNA_def_property_ui_text(prop, "Damping", "Specify the strength of the constraint that drive the camera behind the target");
+ RNA_def_property_ui_text(prop, "Damping", "Strength of the constraint that drives the camera behind the target");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* x/y */
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", "Specify the axis the Camera will try to get behind");
+ RNA_def_property_ui_text(prop, "Axis", "Axis the Camera will try to get behind");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -947,12 +947,12 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
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", "Sets the initial volume of the sound");
+ 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);
RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
- RNA_def_property_ui_text(prop, "Pitch", "Sets the pitch of the sound");
+ RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
@@ -989,7 +989,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
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);
@@ -1118,7 +1118,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
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", "Set the direction of the ray");
+ 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);
@@ -1150,7 +1150,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
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", "Set the maximum length of ray");
+ 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);
@@ -1169,7 +1169,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
//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 detect only Objects with this property");
+ 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);
@@ -1201,14 +1201,14 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
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);
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 */
@@ -1310,7 +1310,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
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 (cant be on an visible layer)");
+ 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);
@@ -1411,13 +1411,13 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
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_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);
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Scene", "Set the Scene to be added/removed/paused/resumed");
+ RNA_def_property_ui_text(prop, "Scene", "Scene to be added/removed/paused/resumed");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* XXX no need for those tooltips. to remove soon
@@ -1462,7 +1462,7 @@ static void rna_def_random_actuator(BlenderRNA *brna)
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);
@@ -1491,7 +1491,7 @@ static void rna_def_random_actuator(BlenderRNA *brna)
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 you stay below this value");
+ 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 */
@@ -1505,13 +1505,13 @@ static void rna_def_random_actuator(BlenderRNA *brna)
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_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);
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_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 */
@@ -1532,26 +1532,26 @@ static void rna_def_random_actuator(BlenderRNA *brna)
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_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);
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_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);
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_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);
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_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 */
@@ -1578,11 +1578,11 @@ static void rna_def_message_actuator(BlenderRNA *brna)
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);
- RNA_def_property_ui_text(prop, "Subject", "Optional message subject. This is what can be filtered on");
+ 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);
@@ -1593,7 +1593,7 @@ static void rna_def_message_actuator(BlenderRNA *brna)
/* ACT_MESG_MESG */
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_ui_text(prop, "Body", "Optional, message body Text");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_MESG_PROP */
@@ -1649,12 +1649,12 @@ static void rna_def_visibility_actuator(BlenderRNA *brna)
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);
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);
@@ -1712,7 +1712,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
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", "Set motion blur factor");
+ 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);
@@ -1828,7 +1828,7 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
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);
@@ -1904,7 +1904,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
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 you want to control");
+ 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);
@@ -1923,7 +1923,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
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", "Set weight of this constraint");
+ RNA_def_property_ui_text(prop, "Weight", "Weight of this constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -1985,7 +1985,7 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
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", "Set target object");
+ 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);
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 1ea1a4e3e7b..6785f1f4caf 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -169,7 +169,7 @@ static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create)
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;
@@ -181,7 +181,7 @@ static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create)
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;
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 1e7a969caaa..6f6a4baec92 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -39,34 +39,21 @@
#ifdef RNA_RUNTIME
+#include "BKE_camera.h"
#include "BKE_object.h"
#include "BKE_depsgraph.h"
-/* only for rad/deg conversion! can remove later */
-static float get_camera_sensor(Camera *cam)
-{
- if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- return cam->sensor_x;
- }
- else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) {
- return cam->sensor_x;
- }
- else {
- return cam->sensor_y;
- }
-}
-
static float rna_Camera_angle_get(PointerRNA *ptr)
{
Camera *cam= ptr->id.data;
- float sensor= get_camera_sensor(cam);
+ 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= get_camera_sensor(cam);
+ float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
cam->lens= fov_to_focallength(value, sensor);
}
@@ -126,9 +113,9 @@ void RNA_def_camera(BlenderRNA *brna)
{CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem sensor_fit_items[] = {
- {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Calculate field of view using sensor size, with direction depending on image resolution"},
- {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Calculate field of view using sensor width"},
- {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Calculate field of view using sensor height"},
+ {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Fit to the sensor width or height depending on image resolution"},
+ {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"},
+ {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Camera", "ID");
@@ -151,7 +138,7 @@ void RNA_def_camera(BlenderRNA *brna)
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", "Mode of calculating field of view from sensor dimensions and focal length");
+ RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
/* Number values */
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index e1e4f3929b2..4ab14550fd1 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -43,6 +43,9 @@
#include "WM_types.h"
EnumPropertyItem constraint_type_items[] ={
+ {0, "", 0, "Motion Tracking", ""},
+ {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""},
+ {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""},
{0, "", 0, "Transform", ""},
{CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", ""},
{CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", ""},
@@ -64,11 +67,9 @@ EnumPropertyItem constraint_type_items[] ={
{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_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""},
{CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""},
{CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""},
{CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""},
- {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""},
{CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""},
{CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""},
{CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""},
@@ -366,7 +367,7 @@ static void rna_def_constraint_childof(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Child Of Constraint", "Creates constraint-based parent-child relationship");
+ 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);
@@ -439,7 +440,7 @@ static void rna_def_constraint_python(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "PythonConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Python Constraint", "Uses Python script for constraint evaluation");
+ 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);
@@ -640,7 +641,7 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Track To Constraint", "Aims the constrained object toward the target");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -684,7 +685,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -747,7 +748,7 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copies the rotation of the target");
+ 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);
@@ -803,7 +804,7 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target");
+ 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);
@@ -851,7 +852,7 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintains a constant volume along a single scaling axis");
+ 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);
@@ -873,7 +874,7 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copies all the transforms of the target");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -909,7 +910,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FloorConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Floor Constraint", "Uses the target object for location limitation");
+ 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);
@@ -1037,7 +1038,7 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -1091,7 +1092,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Locks motion to the target path");
+ 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);
@@ -1136,7 +1137,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
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", "Objects scale by the curve 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");
}
@@ -1158,7 +1159,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretches to meet the target object");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -1208,9 +1209,9 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem pivot_items[] = {
- {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allows rotations around all axes"},
- {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Works in one plane, allows rotations around one axis only"},
- {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", "Allows rotations around all axes with limits for the cone and twist axes"},
+ {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"},
{0, NULL, 0, NULL, NULL}};
@@ -1342,7 +1343,7 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
/* Limit Booleans */
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_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);
@@ -1357,17 +1358,17 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
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_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);
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_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);
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_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -1402,7 +1403,7 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
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_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");
}
@@ -1552,7 +1553,7 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limits the location of the constrained object");
+ 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);
@@ -1633,7 +1634,7 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limits the rotation of the constrained object");
+ 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);
@@ -1699,7 +1700,7 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limits the scaling of the constrained object");
+ 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);
@@ -1780,7 +1781,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -1824,13 +1825,13 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem type_items[] = {
- {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrinks the location to the nearest target surface"},
- {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the location to the nearest target surface along a given axis"},
- {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks 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", "Creates constraint-based shrinkwrap relationship");
+ 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);
@@ -1843,7 +1844,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
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", "Selects type of shrinkwrap algorithm for target position");
+ 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);
@@ -1883,7 +1884,7 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Points toward target by taking the shortest rotation path");
+ 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);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
@@ -2037,13 +2038,8 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem reference_items[] = {
- {FOLLOWTRACK_TRACK, "TRACK", 0, "Track", "Use 2D track position as reference"},
- {FOLLOWTRACK_BUNDLE, "BUNDLE", 0, "Bundle", "Use 3D reconstructed bundle position as reference"},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the target motion track");
+ 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 */
@@ -2059,18 +2055,17 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
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");
- /* reference */
- prop= RNA_def_property(srna, "reference", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "reference");
- RNA_def_property_enum_items(prop, reference_items);
- RNA_def_property_ui_text(prop, "Reference", "Reference source to follow");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
-
/* use default clip */
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);
+ 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");
}
static void rna_def_constraint_camera_solver(BlenderRNA *brna)
@@ -2079,7 +2074,7 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the reconstructed camera movenment");
+ RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Lock motion to the reconstructed camera movement");
RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data");
/* movie clip */
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index f041d3efde4..043645aaf57 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -35,6 +35,8 @@
#include "BKE_context.h"
+#include "rna_internal.h" /* own include */
+
#ifdef RNA_RUNTIME
static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index 89239c10ffd..5278c1e3532 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -258,7 +258,7 @@ void RNA_def_controller(BlenderRNA *brna)
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");
+ 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);
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index d4756ecfefa..48274ffbd7a 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -2409,9 +2409,15 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *iden
ContainerRNA *cont= cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_EULER); // XXX
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
+ 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);
+ }
+ 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);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index 00a73afb789..893993794ba 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -197,17 +197,13 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
}
/* is point cache used */
-static int rna_DynamicPaint_uses_cache_get(PointerRNA *ptr)
+static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
{
DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data;
return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0;
}
-static void rna_DynamicPaint_uses_cache_set(PointerRNA *ptr, int value)
-{
-}
-
/* does output layer exist*/
static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index)
{
@@ -481,16 +477,16 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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 fade faster than low values");
+ RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to fade faster than low values)");
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);
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", "Processes spread effect. Spreads wet paint around surface");
+ 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);
@@ -508,13 +504,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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", "Processes drip effect. Drips wet paint to gravity direction");
+ 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);
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", "Processes shrink effect. Shrinks paint areas");
+ 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);
@@ -532,41 +528,41 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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", "Defines how much surface velocity affects dripping");
+ RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
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", "Defines how much surface acceleration affects dripping");
+ RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping");
/*
* Output settings
*/
- prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
+ 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", "Multiplies color by alpha. (Recommended for Blender input)");
+ 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);
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", 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", "");
- prop= RNA_def_property(srna, "do_output1", 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, "Save layer", "Output name");
/* output for secondary sufrace data */
- prop= RNA_def_property(srna, "output_name2", 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", "Output name");
- prop= RNA_def_property(srna, "do_output2", 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, "Save layer", "");
@@ -592,7 +588,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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);
@@ -627,8 +623,8 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
prop= RNA_def_property(srna, "wave_speed", 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_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);
@@ -641,9 +637,9 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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, "wave_open_borders", 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", "Passes waves through mesh edges");
+ RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
/* cache */
@@ -653,10 +649,10 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Point Cache", "");
/* is cache used */
- prop= RNA_def_property(srna, "uses_cache", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_uses_cache_get", "rna_DynamicPaint_uses_cache_set");
- RNA_def_property_ui_text(prop, "Uses Cache", "");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ 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);
}
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
@@ -700,6 +696,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
+ {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
@@ -739,11 +736,11 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "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");
@@ -751,10 +748,10 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "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");
@@ -762,7 +759,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "Brush Effect", "");
+ RNA_def_property_ui_text(prop, "Wave Type", "");
prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -2.0, 2.0);
@@ -772,33 +769,34 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "do_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", "Makes this brush to smudge existing paint as it moves");
+ 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);
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, "max_velocity", 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, "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, "velocity_depth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH);
RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "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");
@@ -820,9 +818,9 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "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 reads color 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);
@@ -832,7 +830,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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, "proximity_project", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT);
RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
@@ -840,15 +838,15 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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", "Defines 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, "proximity_inverse", 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, "negate_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");
@@ -867,7 +865,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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", "Uses radius from particle settings");
+ 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);
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index c651dca4b31..56f1efe3fed 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -637,7 +637,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier");
- RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve");
+ 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 */
@@ -659,7 +659,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
// 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)");
+ "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 */
@@ -689,7 +689,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier");
- RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generates values using a Built-In Function");
+ 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 */
@@ -765,7 +765,7 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier");
- RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scales the values of the modified F-Curve");
+ 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 */
@@ -802,13 +802,13 @@ 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 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");
- RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeats the values of the modified F-Curve");
+ 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 */
@@ -820,7 +820,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
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 */
@@ -832,7 +832,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
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);
}
@@ -844,7 +844,7 @@ static void rna_def_fmodifier_python(BlenderRNA *brna)
//PropertyRNA *prop;
srna= RNA_def_struct(brna, "FModifierPython", "FModifier");
- RNA_def_struct_ui_text(srna, "Python F-Modifier", "Performs user-defined operation on the modified F-Curve");
+ 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");
}
@@ -856,7 +856,7 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "FModifierLimits", "FModifier");
- RNA_def_struct_ui_text(srna, "Limits F-Modifier", "Limits the time/value ranges of the modified F-Curve");
+ 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);
@@ -919,7 +919,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FModifierNoise", "FModifier");
- RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Gives randomness to the modified F-Curve");
+ 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);
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index a7eedf5f062..09f339fa7db 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -83,18 +83,19 @@ static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
}
-static int fluidsim_find_lastframe(FluidsimSettings *fss)
+static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
{
- char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
+ char targetFileTest[FILE_MAX];
+ char targetFile[FILE_MAX];
int curFrame = 1;
- BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath);
- BLI_path_abs(targetDir, G.main->name);
+ BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME);
+ BLI_path_abs(targetFile, modifier_path_relbase(ob));
do {
- BLI_strncpy(targetFile, targetDir, sizeof(targetFile));
- BLI_path_frame(targetFile, curFrame++, 0);
- } while(BLI_exists(targetFile));
+ BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest));
+ BLI_path_frame(targetFileTest, curFrame++, 0);
+ } while(BLI_exists(targetFileTest));
return curFrame - 1;
}
@@ -105,7 +106,7 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
FluidsimModifierData *fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
if(fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) {
- fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(fluidmd->fss);
+ fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss);
}
else {
fluidmd->fss->lastgoodframe = -1;
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index fe2cfbd3bc0..47de66dd560 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1146,6 +1146,45 @@ static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bConte
return cdl;
}
+static CustomDataLayer *rna_Mesh_int_property_new(struct Mesh *me, struct bContext *C, const char *name)
+{
+ CustomDataLayer *cdl = NULL;
+ int index;
+
+ CustomData_add_layer_named(&me->fdata, CD_PROP_INT, CD_DEFAULT, NULL, me->totface, name);
+ index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_INT, name);
+
+ cdl = (index == -1) ? NULL : &(me->fdata.layers[index]);
+
+ return cdl;
+}
+
+static CustomDataLayer *rna_Mesh_float_property_new(struct Mesh *me, struct bContext *C, const char *name)
+{
+ CustomDataLayer *cdl = NULL;
+ int index;
+
+ CustomData_add_layer_named(&me->fdata, CD_PROP_FLT, CD_DEFAULT, NULL, me->totface, name);
+ index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_FLT, name);
+
+ cdl = (index == -1) ? NULL : &(me->fdata.layers[index]);
+
+ return cdl;
+}
+
+static CustomDataLayer *rna_Mesh_string_property_new(struct Mesh *me, struct bContext *C, const char *name)
+{
+ CustomDataLayer *cdl = NULL;
+ int index;
+
+ CustomData_add_layer_named(&me->fdata, CD_PROP_STR, CD_DEFAULT, NULL, me->totface, name);
+ index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_STR, name);
+
+ cdl = (index == -1) ? NULL : &(me->fdata.layers[index]);
+
+ return cdl;
+}
+
static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, const char *name)
{
CustomData *fdata;
@@ -1646,7 +1685,8 @@ static void rna_def_mproperties(BlenderRNA *brna)
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");
- prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ /* low level mesh data access, treat as bytes */
+ 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");
@@ -1760,6 +1800,69 @@ static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
+/* mesh int layers */
+static void rna_def_int_layers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "IntProperties");
+ 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");
+ 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");
+ RNA_def_function_return(func, parm);
+}
+
+/* mesh float layers */
+static void rna_def_float_layers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "FloatProperties");
+ 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");
+ 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");
+ RNA_def_function_return(func, parm);
+}
+
+/* mesh string layers */
+static void rna_def_string_layers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "StringProperties");
+ 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");
+ 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");
+ RNA_def_function_return(func, parm);
+}
+
/* mesh.uv_layers */
static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -1886,6 +1989,7 @@ static void rna_def_mesh(BlenderRNA *brna)
"rna_Mesh_float_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
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);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
@@ -1893,6 +1997,7 @@ static void rna_def_mesh(BlenderRNA *brna)
"rna_Mesh_int_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
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);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
@@ -1900,6 +2005,7 @@ static void rna_def_mesh(BlenderRNA *brna)
"rna_Mesh_string_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 32665bef065..6885000ce18 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -88,14 +88,15 @@ EnumPropertyItem modifier_type_items[] ={
{0, "", 0, "Simulate", ""},
{eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
{eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
+ {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""},
{eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
{eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
+ {eModifierType_Ocean, "OCEAN", ICON_MOD_WAVE, "Ocean", ""},
{eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
{eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
{eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""},
{eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
{eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
- {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -186,6 +187,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_SolidifyModifier;
case eModifierType_Screw:
return &RNA_ScrewModifier;
+ case eModifierType_Ocean:
+ return &RNA_OceanModifier;
case eModifierType_Warp:
return &RNA_WarpModifier;
case eModifierType_WeightVGEdit:
@@ -649,6 +652,57 @@ static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
md->projectors[a]= NULL;
}
+static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr))
+{
+#ifdef WITH_OCEANSIM
+ return 1;
+#else // WITH_OCEANSIM
+ return 0;
+#endif // WITH_OCEANSIM
+}
+
+static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ OceanModifierData *omd= (OceanModifierData*)ptr->data;
+
+ omd->refresh |= (MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM|MOD_OCEAN_REFRESH_CLEAR_CACHE);
+
+ rna_Modifier_update(bmain, scene, ptr);
+}
+
+static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ OceanModifierData *omd= (OceanModifierData*)ptr->data;
+
+ omd->refresh |= MOD_OCEAN_REFRESH_SIM;
+
+ rna_Modifier_update(bmain, scene, ptr);
+}
+
+static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ OceanModifierData *omd= (OceanModifierData*)ptr->data;
+
+ omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY;
+
+ rna_Modifier_update(bmain, scene, ptr);
+}
+
+static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
+{
+ OceanModifierData *omd= (OceanModifierData*)ptr->data;
+ float old_value = omd->chop_amount;
+
+ omd->chop_amount = value;
+
+ if ((old_value == 0.0f && value > 0.0f) ||
+ (old_value > 0.0f && value == 0.0f))
+ {
+ omd->refresh |= MOD_OCEAN_REFRESH_RESET;
+ omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE;
+ }
+}
+
static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr)
{
EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
@@ -2809,6 +2863,185 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
rna_def_modifier_weightvg_mask(brna, srna);
}
+static void rna_def_modifier_ocean(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem geometry_items[]= {
+ {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generates ocean surface geometry at the specified resolution"},
+ {MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displaces 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)"},
+ {0, NULL, 0, NULL, NULL}};
+
+ 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_FLUIDSIM);
+
+ /* General check if blender was built with OceanSim modifier support */
+ 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);
+ 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);
+ 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);
+ RNA_def_property_int_sdna(prop, NULL, "repeat_x");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_range(prop, 1, 100, 1, 0);
+ 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);
+ RNA_def_property_int_sdna(prop, NULL, "repeat_y");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_range(prop, 1, 100, 1, 0);
+ 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);
+ 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", "Outputs 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);
+ 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", "Generates 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);
+ RNA_def_property_int_sdna(prop, NULL, "resolution");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_range(prop, 1, 32, 1, 0);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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 useing cached data or simulating");
+
+ 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?
+}
+
+
void RNA_def_modifier(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2910,6 +3143,7 @@ void RNA_def_modifier(BlenderRNA *brna)
rna_def_modifier_weightvgmix(brna);
rna_def_modifier_weightvgproximity(brna);
rna_def_modifier_dynamic_paint(brna);
+ rna_def_modifier_ocean(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c
index 91e082cdeae..3b1ac8f22c3 100644
--- a/source/blender/makesrna/intern/rna_movieclip.c
+++ b/source/blender/makesrna/intern/rna_movieclip.c
@@ -87,19 +87,19 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
/* build proxy sized */
prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_25);
- RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_50);
- RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_75);
- RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_100);
- RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
+ RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");
prop= RNA_def_property(srna, "build_undistorted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_flag", MCLIP_PROXY_BUILD_UNDISTORT);
@@ -121,7 +121,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
/* quality of proxied image */
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_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);
@@ -169,7 +169,7 @@ static void rna_def_moviecliUser(BlenderRNA *brna)
/* render undistorted */
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", "Draw preview using undistorted proxy");
+ RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
}
@@ -198,7 +198,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
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 text file");
+ 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);
@@ -234,7 +234,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
/* custom proxy directory */
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_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
+ 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 */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 55693f8e53f..30889bb25f6 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -70,43 +70,43 @@ EnumPropertyItem node_socket_type_items[] = {
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem node_math_items[] = {
-{ 0, "ADD", 0, "Add", ""},
-{ 1, "SUBTRACT", 0, "Subtract", ""},
-{ 2, "MULTIPLY", 0, "Multiply", ""},
-{ 3, "DIVIDE", 0, "Divide", ""},
-{ 4, "SINE", 0, "Sine", ""},
-{ 5, "COSINE", 0, "Cosine", ""},
-{ 6, "TANGENT", 0, "Tangent", ""},
-{ 7, "ARCSINE", 0, "Arcsine", ""},
-{ 8, "ARCCOSINE", 0, "Arccosine", ""},
-{ 9, "ARCTANGENT", 0, "Arctangent", ""},
-{10, "POWER", 0, "Power", ""},
-{11, "LOGARITHM", 0, "Logarithm", ""},
-{12, "MINIMUM", 0, "Minimum", ""},
-{13, "MAXIMUM", 0, "Maximum", ""},
-{14, "ROUND", 0, "Round", ""},
-{15, "LESS_THAN", 0, "Less Than", ""},
-{16, "GREATER_THAN", 0, "Greater Than", ""},
-{0, NULL, 0, NULL, NULL}};
+ { 0, "ADD", 0, "Add", ""},
+ { 1, "SUBTRACT", 0, "Subtract", ""},
+ { 2, "MULTIPLY", 0, "Multiply", ""},
+ { 3, "DIVIDE", 0, "Divide", ""},
+ { 4, "SINE", 0, "Sine", ""},
+ { 5, "COSINE", 0, "Cosine", ""},
+ { 6, "TANGENT", 0, "Tangent", ""},
+ { 7, "ARCSINE", 0, "Arcsine", ""},
+ { 8, "ARCCOSINE", 0, "Arccosine", ""},
+ { 9, "ARCTANGENT", 0, "Arctangent", ""},
+ {10, "POWER", 0, "Power", ""},
+ {11, "LOGARITHM", 0, "Logarithm", ""},
+ {12, "MINIMUM", 0, "Minimum", ""},
+ {13, "MAXIMUM", 0, "Maximum", ""},
+ {14, "ROUND", 0, "Round", ""},
+ {15, "LESS_THAN", 0, "Less Than", ""},
+ {16, "GREATER_THAN", 0, "Greater Than", ""},
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem node_vec_math_items[] = {
-{0, "ADD", 0, "Add", ""},
-{1, "SUBTRACT", 0, "Subtract", ""},
-{2, "AVERAGE", 0, "Average", ""},
-{3, "DOT_PRODUCT", 0, "Dot Product", ""},
-{4, "CROSS_PRODUCT", 0, "Cross Product", ""},
-{5, "NORMALIZE", 0, "Normalize", ""},
-{0, NULL, 0, NULL, NULL}};
+ {0, "ADD", 0, "Add", ""},
+ {1, "SUBTRACT", 0, "Subtract", ""},
+ {2, "AVERAGE", 0, "Average", ""},
+ {3, "DOT_PRODUCT", 0, "Dot Product", ""},
+ {4, "CROSS_PRODUCT", 0, "Cross Product", ""},
+ {5, "NORMALIZE", 0, "Normalize", ""},
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem node_filter_items[] = {
-{0, "SOFTEN", 0, "Soften", ""},
-{1, "SHARPEN", 0, "Sharpen", ""},
-{2, "LAPLACE", 0, "Laplace", ""},
-{3, "SOBEL", 0, "Sobel", ""},
-{4, "PREWITT", 0, "Prewitt", ""},
-{5, "KIRSCH", 0, "Kirsch", ""},
-{6, "SHADOW", 0, "Shadow", ""},
-{0, NULL, 0, NULL, NULL}};
+ {0, "SOFTEN", 0, "Soften", ""},
+ {1, "SHARPEN", 0, "Sharpen", ""},
+ {2, "LAPLACE", 0, "Laplace", ""},
+ {3, "SOBEL", 0, "Sobel", ""},
+ {4, "PREWITT", 0, "Prewitt", ""},
+ {5, "KIRSCH", 0, "Kirsch", ""},
+ {6, "SHADOW", 0, "Shadow", ""},
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem prop_noise_basis_items[] = {
{SHD_NOISE_PERLIN, "PERLIN", 0, "Perlin", ""},
@@ -124,11 +124,13 @@ EnumPropertyItem prop_noise_type_items[] = {
{SHD_NOISE_HARD, "HARD", 0, "Hard", ""},
{0, NULL, 0, NULL, NULL}};
+#if 0
EnumPropertyItem prop_wave_items[] = {
{SHD_WAVE_SINE, "SINE", 0, "Sine", "Uses a sine wave to produce bands"},
{SHD_WAVE_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"},
{SHD_WAVE_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
+#endif
/* Add any new socket value subtype here.
* When adding a new subtype here, make sure you also add it
@@ -755,6 +757,13 @@ static bNodeSocket *rna_NodeTree_output_expose(bNodeTree *ntree, ReportList *rep
return NULL;
}
+static void rna_Mapping_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ bNode *node = ptr->data;
+ init_tex_mapping(node->storage);
+ rna_Node_update(bmain, scene, ptr);
+}
+
#else
static EnumPropertyItem prop_image_layer_items[] = {
@@ -1095,12 +1104,43 @@ static void def_sh_material(StructRNA *srna)
static void def_sh_mapping(StructRNA *srna)
{
PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "TexMapping", "storage");
- prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "storage");
- RNA_def_property_struct_type(prop, "TexMapping");
- RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_ui_text(prop, "Mapping", "Texture coordinate mapping settings");
+ 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 */
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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");
}
static void def_sh_geometry(StructRNA *srna)
@@ -1928,17 +1968,17 @@ static void def_cmp_chroma_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
- RNA_def_property_range(prop, 1.0f, 80.0f);
+ RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(80.0f));
RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
- RNA_def_property_range(prop, 0.0f, 30.0f);
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(30.0f));
RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2103,9 +2143,9 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
/* TODO: angle in degrees */
- prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "rotation");
- RNA_def_property_range(prop, 0, 90);
+ 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));
RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2271,15 +2311,15 @@ static void def_cmp_dblur(StructRNA *srna)
RNA_def_property_ui_text(prop, "Distance", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "angle");
- RNA_def_property_range(prop, 0.0f, 360.0f);
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(360.0f));
RNA_def_property_ui_text(prop, "Angle", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "spin");
- RNA_def_property_range(prop, -360.0f, 360.0f);
+ RNA_def_property_range(prop, DEG2RADF(-360.0f), DEG2RADF(360.0f));
RNA_def_property_ui_text(prop, "Spin", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2393,10 +2433,10 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "angle_offset", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "angle_ofs");
- RNA_def_property_range(prop, 0, 180);
- RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees");
+ prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "angle_ofs");
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
+ RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index c4508c718e5..5b8b9d9a6b2 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -128,16 +128,20 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
free_libblock_us( &G.main->object, tmpobj );
break;
- case OB_MBALL:
+ case OB_MBALL: {
/* metaballs don't have modifiers, so just convert to mesh */
- ob = find_basis_mball( sce, ob );
+ Object *basis_ob = find_basis_mball( sce, ob );
/* todo, re-generatre for render-res */
/* metaball_polygonize(scene, ob) */
+ if(ob != basis_ob)
+ return NULL; /* only do basis metaball */
+
tmpmesh = add_mesh("Mesh");
mball_to_mesh( &ob->disp, tmpmesh );
break;
+ }
case OB_MESH:
/* copies object and modifiers (but not the data) */
if (cage) {
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index d224bd0d4e5..6290c01f992 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -157,7 +157,7 @@ static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
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;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 9c4a0984596..b08bdd7d223 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -737,6 +737,28 @@ static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA valu
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);
+
+ 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)
+{
+ 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);
+ }
+ else {
+ WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ }
+}
+
static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -1147,8 +1169,8 @@ static void rna_def_transform_orientation(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_string_sdna(prop, NULL, "name");
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);
}
@@ -2624,8 +2646,8 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
- // FunctionRNA *func;
- // PropertyRNA *parm;
+ FunctionRNA *func;
+ PropertyRNA *parm;
RNA_def_property_srna(cprop, "RenderLayers");
srna= RNA_def_struct(brna, "RenderLayers", NULL);
@@ -2647,6 +2669,19 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ func= RNA_def_function(srna, "new", "rna_RenderLayer_new");
+ 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)");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ 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");
+ 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");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_scene_render_data(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 250c61ed5f4..6816903090d 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -77,7 +77,7 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name
if(BKE_imtype_is_movie(rd->imtype))
BKE_makeanimstring(name, rd);
else
- BKE_makepicstring(name, rd->pic, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, rd->pic, G.main->name, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION, TRUE);
}
#ifdef WITH_COLLADA
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index f3b158f84fe..4db23443895 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -191,6 +191,13 @@ static int rna_Sequence_frame_length_get(PointerRNA *ptr)
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
}
+static int rna_Sequence_frame_editable(PointerRNA *ptr)
+{
+ Sequence *seq = (Sequence*)ptr->data;
+ /* Effect sequences' start frame and length must be readonly! */
+ return (get_sequence_effect_num_inputs(seq->type))? 0: PROP_EDITABLE;
+}
+
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
Sequence *seq= (Sequence*)ptr->data;
@@ -1025,8 +1032,9 @@ static void rna_def_sequence(BlenderRNA *brna)
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 before the handles are applied");
+ RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_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_duration", PROP_INT, PROP_TIME);
@@ -1040,6 +1048,7 @@ static void rna_def_sequence(BlenderRNA *brna)
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_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);
@@ -1047,6 +1056,7 @@ static void rna_def_sequence(BlenderRNA *brna)
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_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);
@@ -1054,6 +1064,7 @@ static void rna_def_sequence(BlenderRNA *brna)
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_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);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 31f3d59e643..a33622cf8a1 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -891,15 +891,26 @@ static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
bgpic->blend = 1.0f - value;
}
-static BGpic *rna_BackgroundImage_add(View3D *v3d)
+static BGpic *rna_BackgroundImage_new(View3D *v3d)
{
- BGpic *bgpic= ED_view3D_background_image_add(v3d);;
+ BGpic *bgpic= ED_view3D_background_image_new(v3d);
- WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
return bgpic;
}
+static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, BGpic *bgpic)
+{
+ if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) {
+ BKE_report(reports, RPT_ERROR, "BackgroundImage can't be removed");
+ }
+ else {
+ ED_view3D_background_image_remove(v3d, bgpic);
+ WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ }
+}
+
/* Space Node Editor */
static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value)
@@ -1307,11 +1318,16 @@ static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
- func= RNA_def_function(srna, "add", "rna_BackgroundImage_add");
+ 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");
RNA_def_function_return(func, parm);
+
+ 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");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_space_view3d(BlenderRNA *brna)
@@ -1579,26 +1595,26 @@ static void rna_def_space_view3d(BlenderRNA *brna)
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, "bundle_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, "Bundle Size", "Display size of bundles from reconstructed data");
+ 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, "bundle_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, "Bundle Display Type", "Viewport display style for bundles");
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH);
- RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed path of camera");
+ 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_name", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_tracks_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME);
- RNA_def_property_ui_text(prop, "Show Bundle Name", "Show names for bundle objects");
+ RNA_def_property_ui_text(prop, "Show Track Names", "Show names for tracks objects");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
/* region */
@@ -2893,7 +2909,7 @@ static void rna_def_space_clip(BlenderRNA *brna)
/* show tiny markers */
prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers tiny");
+ 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);
@@ -2960,13 +2976,13 @@ static void rna_def_space_clip(BlenderRNA *brna)
/* show graph_frames */
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 curves for frames in graph editor");
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS);
- RNA_def_property_ui_text(prop, "Show Tracks", "Show curves for tracks in graph editor");
+ 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);
}
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index a0d0bc088f7..9e3611b4cc5 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -42,7 +42,7 @@
#ifdef RNA_RUNTIME
-int text_file_modified(Text *text);
+int text_file_modified(Text *text); /* XXX bad level call */
static void rna_Text_filename_get(PointerRNA *ptr, char *value)
{
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index ec669b28918..acfcad80f19 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -28,11 +28,25 @@
#include <stdlib.h>
#include <stdio.h>
-
#include "RNA_define.h"
#ifdef RNA_RUNTIME
+#include "WM_api.h"
+#include "WM_types.h"
+
+static void rna_Text_clear(Text *text)
+{
+ clear_text(text);
+ WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
+static void rna_Text_write(Text *text, const char *str)
+{
+ write_text(text, str);
+ WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
#else
void RNA_api_text(StructRNA *srna)
@@ -40,10 +54,10 @@ void RNA_api_text(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *prop;
- func= RNA_def_function(srna, "clear", "clear_text");
+ 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", "write_text");
+ 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");
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 aac4da9e6f6..e2c105e9ba8 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -73,6 +73,7 @@ EnumPropertyItem texture_type_items[] = {
{TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Create cell-like patterns based on Worley noise"},
{TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"},
+ {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem blend_type_items[] = {
@@ -145,6 +146,8 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
return &RNA_VoxelDataTexture;
case TEX_WOOD:
return &RNA_WoodTexture;
+ case TEX_OCEAN:
+ return &RNA_OceanTexture;
default:
return &RNA_Texture;
}
@@ -435,6 +438,11 @@ static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr))
return BLI_sprintfN("voxel_data");
}
+static char *rna_OceanTex_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("ocean");
+}
+
#else
static void rna_def_texmapping(BlenderRNA *brna)
@@ -464,7 +472,7 @@ static void rna_def_texmapping(BlenderRNA *brna)
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_XYZ); /* Not PROP_EUL, this is already in degrees, not radians */
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
@@ -1860,6 +1868,49 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
}
+static void rna_def_texture_ocean(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ 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_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);
+ 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);
+ 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);
+ 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");
+ 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);
+ 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");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+}
+
static void rna_def_texture(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1962,6 +2013,7 @@ static void rna_def_texture(BlenderRNA *brna)
rna_def_texture_distorted_noise(brna);
rna_def_texture_pointdensity(brna);
rna_def_texture_voxeldata(brna);
+ rna_def_texture_ocean(brna);
/* XXX add more types here .. */
RNA_api_texture(srna);
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 2c6384c75d8..269860e1d7e 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -39,6 +39,7 @@
#include "rna_internal.h"
#include "DNA_movieclip_types.h"
+#include "DNA_object_types.h" /* SELECT */
#include "DNA_scene_types.h"
#include "WM_types.h"
@@ -94,6 +95,29 @@ void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value)
BKE_track_unique_name(&clip->tracking, track);
}
+static int rna_trackingTrack_select_get(PointerRNA *ptr)
+{
+ MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+
+ return TRACK_SELECTED(track);
+}
+
+static void rna_trackingTrack_select_set(PointerRNA *ptr, int value)
+{
+ MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+
+ 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;
+ }
+}
+
static void rna_tracking_trackerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
@@ -145,7 +169,8 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
if(clip->lastsize[0])
value= clip->lastsize[0]*value/camera->sensor_width;
- camera->focal= value;
+ if(value>=0.0001)
+ camera->focal= value;
}
static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
@@ -229,6 +254,23 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ 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_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center", "Refine focal length and optical center"},
+ {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_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_FOCAL_LENGTH|REFINE_RADIAL_DISTORTION_K1, "FOCAL_LENGTH_RADIAL_K1", 0, "Focal length, K1", "Refine focal length and radial distortion K1"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna= RNA_def_struct(brna, "MovieTrackingSettings", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings");
@@ -236,14 +278,14 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
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", "Speed to make tracking with");
+ RNA_def_property_ui_text(prop, "Speed", "Limit speed of tracking to make visual feedback easier (this does not affect the tracking quality)");
/* limit frames */
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_range(prop, 0, SHRT_MAX);
- RNA_def_property_ui_text(prop, "Frames Limit", "Amount of frames to be tracked during single tracking operation");
+ RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this amount of frames are tracked");
/* adjust frames */
prop= RNA_def_property(srna, "frames_adjust", PROP_INT, PROP_NONE);
@@ -257,7 +299,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0, 300);
- RNA_def_property_ui_text(prop, "Margin", "Margin for markers from image boundary");
+ RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking");
/* keyframe_a */
prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
@@ -271,6 +313,13 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
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);
+ 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);
+ RNA_def_property_ui_text(prop, "Refine", "Refine intrinsics during camera solving");
+
/* tool settings */
/* distance */
@@ -324,7 +373,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
/* Focal Length */
prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "focal");
- RNA_def_property_range(prop, 0.0f, 5000.0f);
+ RNA_def_property_range(prop, 0.0001f, 5000.0f);
RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL);
RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
@@ -374,7 +423,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "pixel_aspect");
RNA_def_property_range(prop, 0.1f, 5000.0f);
RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
- RNA_def_property_ui_text(prop, "Pixel Aspect", "Pixel aspect ratio");
+ RNA_def_property_ui_text(prop, "Pixel Aspect Ratio", "Pixel aspect ratio");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
}
@@ -402,9 +451,9 @@ static void rna_def_trackingMarker(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* enable */
- prop= RNA_def_property(srna, "enable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MARKER_DISABLED);
- RNA_def_property_ui_text(prop, "Enable", "Is marker enabled for current frame");
+ 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);
}
@@ -417,8 +466,8 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
PropertyRNA *parm;
static EnumPropertyItem tracker_items[] = {
- {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker"},
- {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker"},
+ {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 MLT tracker fails"},
{0, NULL, 0, NULL, NULL}};
rna_def_trackingMarker(brna);
@@ -477,7 +526,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "pyramid_levels");
RNA_def_property_range(prop, 1, 16);
- RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels for KLT tracking");
+ RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels (increase on blurry footage)");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update");
/* minmal correlation - only used for SAD tracker */
@@ -533,6 +582,30 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
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);
+ 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);
+ 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);
+ 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);
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED);
@@ -549,7 +622,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
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 Clip Editor");
+ 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 */
@@ -612,7 +685,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
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, "Miximal Scale", "Maximal value for scale factor");
+ RNA_def_property_ui_text(prop, "Maximal Scale", "Limits the amount of automatic scaling");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* influence_location */
@@ -629,6 +702,12 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
+ /* use_stabilize_rotation */
+ prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION);
+ RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot");
+ 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);
RNA_def_property_float_sdna(prop, NULL, "rotinf");
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 58d6911cf17..be0fec41aa1 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -56,6 +56,8 @@ EnumPropertyItem operator_context_items[] = {
#ifdef RNA_RUNTIME
+#include <assert.h>
+
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
@@ -411,6 +413,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
}
+static char _menu_descr[RNA_DYN_DESCR_MAX];
static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
@@ -418,11 +421,17 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
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;
/* setup dummy menu & menu type to store static properties in */
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';
+
/* validate the python class */
if(validate(&dummymtr, data, have_function) != 0)
return NULL;
@@ -439,9 +448,20 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
rna_Menu_unregister(bmain, mt->ext.srna);
/* create a new menu type */
- mt= MEM_callocN(sizeof(MenuType), "python buttons menu");
+ if (_menu_descr[0]) {
+ description_size= strlen(_menu_descr) + 1;
+ over_alloc += description_size;
+ }
+
+ mt= MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu");
memcpy(mt, &dummymt, sizeof(dummymt));
+ if (_menu_descr[0]) {
+ char *buf= (char *)(mt + 1);
+ memcpy(buf, _menu_descr, description_size);
+ mt->description= buf;
+ }
+
mt->ext.srna= RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu");
mt->ext.data= data;
mt->ext.call= call;
@@ -466,6 +486,14 @@ static StructRNA* rna_Menu_refine(PointerRNA *mtr)
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 */
+ else assert(!"setting the bl_description on a non-builtin menu");
+}
+
static int rna_UILayout_active_get(PointerRNA *ptr)
{
return uiLayoutGetActive(ptr->data);
@@ -800,6 +828,13 @@ static void rna_def_menu(BlenderRNA *brna)
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);
+ 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_flag(prop, PROP_REGISTER_OPTIONAL);
+
RNA_define_verify_sdna(1);
}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 366ba1daf85..4c97a926513 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -429,7 +429,8 @@ void RNA_api_ui_layout(StructRNA *srna)
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 "
- "of its properties should have a widget displayed in its row");
+ "of its properties should have a widget displayed in its row "
+ "(format: \"propname1:propname2:propname3:...\")");
RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
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");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 8406f232653..ad2b49e5d41 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -506,6 +506,25 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
+static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ 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);
+ 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);
+ RNA_def_property_ui_text(prop, "Show Header", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+}
+
static void rna_def_userdef_theme_ui(BlenderRNA *brna)
{
StructRNA *srna;
@@ -513,6 +532,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
rna_def_userdef_theme_ui_wcol(brna);
rna_def_userdef_theme_ui_wcol_state(brna);
+ rna_def_userdef_theme_ui_panel(brna);
srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
RNA_def_struct_sdna(srna, "ThemeUI");
@@ -521,127 +541,102 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
- RNA_def_property_struct_type(prop, "ThemeWidgetColors");
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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
- RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
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);
+ 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);
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);
+ 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");
}
static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
@@ -2630,7 +2625,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
- {9, "SPANISH", 0, "Spanish (Español)", "es_ES"},
+ {9, "SPANISH", 0, "Spanish (Español)", "es"},
{0, "", 0, "In progress", ""},
{2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},
@@ -2964,12 +2959,6 @@ static void rna_def_userdef_input(BlenderRNA *brna)
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: orbit */
- prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
- RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
- /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */
-
/* 3D view: roll */
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);
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index dfbdafd7d18..8e05e43b48f 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -338,41 +338,43 @@ EnumPropertyItem keymap_propvalue_items[] = {
{0, "NONE", 0, "", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem keymap_modifiers_items[] = {
- {KM_ANY, "ANY", 0, "Any", ""},
- {0, "NONE", 0, "None", ""},
- {1, "FIRST", 0, "First", ""},
- {2, "SECOND", 0, "Second", ""},
- {0, NULL, 0, NULL, NULL}};
+#if 0
+static EnumPropertyItem keymap_modifiers_items[] = {
+ {KM_ANY, "ANY", 0, "Any", ""},
+ {0, "NONE", 0, "None", ""},
+ {1, "FIRST", 0, "First", ""},
+ {2, "SECOND", 0, "Second", ""},
+ {0, NULL, 0, NULL, NULL}};
+#endif
EnumPropertyItem operator_flag_items[] = {
- {OPTYPE_REGISTER, "REGISTER", 0, "Register", "Display in the info window and support the redo toolbar panel"},
- {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_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}};
+ {OPTYPE_REGISTER, "REGISTER", 0, "Register", "Display in the info window and support the redo toolbar panel"},
+ {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_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}};
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
- {0, NULL, 0, NULL, NULL}};
+ {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
+ {0, NULL, 0, NULL, NULL}};
/* flag/enum */
EnumPropertyItem wm_report_items[] = {
- {RPT_DEBUG, "DEBUG", 0, "Debug", ""},
- {RPT_INFO, "INFO", 0, "Info", ""},
- {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""},
- {RPT_WARNING, "WARNING", 0, "Warning", ""},
- {RPT_ERROR, "ERROR", 0, "Error", ""},
- {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\
- {RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""},
- {RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""},
- {0, NULL, 0, NULL, NULL}};
+ {RPT_DEBUG, "DEBUG", 0, "Debug", ""},
+ {RPT_INFO, "INFO", 0, "Info", ""},
+ {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""},
+ {RPT_WARNING, "WARNING", 0, "Warning", ""},
+ {RPT_ERROR, "ERROR", 0, "Error", ""},
+ {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\
+ {RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""},
+ {RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""},
+ {0, NULL, 0, NULL, NULL}};
#define KMI_TYPE_KEYBOARD 0
#define KMI_TYPE_MOUSE 1
@@ -419,7 +421,7 @@ static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create)
{
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;
@@ -964,7 +966,7 @@ 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[1024];
+static char _operator_descr[RNA_DYN_DESCR_MAX];
static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {NULL};
@@ -1159,7 +1161,7 @@ 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]) strcpy(str, value);
+ 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");
}
@@ -1167,7 +1169,7 @@ 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]) strcpy(str, value);
+ 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");
}
@@ -1175,7 +1177,7 @@ 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]) strcpy(str, value);
+ 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");
}
@@ -1230,14 +1232,14 @@ static void rna_def_operator(BlenderRNA *brna)
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, 1024); /* else it uses the pointer size! */
+ 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_flag(prop, PROP_REGISTER);
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, 1024); /* else it uses the pointer size! */
+ 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_flag(prop, PROP_REGISTER_OPTIONAL);
@@ -1291,14 +1293,14 @@ static void rna_def_macro_operator(BlenderRNA *brna)
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
- RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ 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_flag(prop, PROP_REGISTER);
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, 1024); /* else it uses the pointer size! */
+ 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_flag(prop, PROP_REGISTER_OPTIONAL);
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index e8ecc75ca60..87498b3bb63 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -67,6 +67,7 @@ set(SRC
intern/MOD_mirror.c
intern/MOD_multires.c
intern/MOD_none.c
+ intern/MOD_ocean.c
intern/MOD_particleinstance.c
intern/MOD_particlesystem.c
intern/MOD_screw.c
@@ -116,6 +117,10 @@ if(WITH_MOD_FLUID)
add_definitions(-DWITH_MOD_FLUID)
endif()
+if(WITH_MOD_OCEANSIM)
+ add_definitions(-DWITH_OCEANSIM)
+endif()
+
if(WITH_GAMEENGINE)
# for MOD_navmesh.c
add_definitions(-DWITH_GAMEENGINE)
@@ -125,4 +130,8 @@ if(WITH_GAMEENGINE)
)
endif()
+if(WITH_OPENMP)
+ add_definitions(-DPARALLEL=1)
+endif()
+
blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index 8ffb7803bb1..cc077694384 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -69,6 +69,7 @@ extern ModifierTypeInfo modifierType_Smoke;
extern ModifierTypeInfo modifierType_ShapeKey;
extern ModifierTypeInfo modifierType_Solidify;
extern ModifierTypeInfo modifierType_Screw;
+extern ModifierTypeInfo modifierType_Ocean;
extern ModifierTypeInfo modifierType_Warp;
extern ModifierTypeInfo modifierType_NavMesh;
extern ModifierTypeInfo modifierType_WeightVGEdit;
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index 277ed2c3fb3..8273ab0d1fe 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -22,6 +22,9 @@ if env ['WITH_BF_DECIMATE']:
if env['WITH_BF_FLUID']:
defs.append('WITH_MOD_FLUID')
+if env['WITH_BF_OCEANSIM']:
+ defs.append('WITH_OCEANSIM')
+
if env['WITH_BF_GAMEENGINE']:
incs += ' #/extern/recastnavigation'
defs.append('WITH_GAMEENGINE')
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index c6b9e5752e0..29ff5975e85 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -161,20 +161,20 @@ ModifierTypeInfo modifierType_DynamicPaint = {
| eModifierTypeFlag_Single,
/* copyData */ copyData,
- /* deformVerts */ 0,
- /* deformMatrices */ 0,
- /* deformVertsEM */ 0,
- /* deformMatricesEM */ 0,
+ /* deformVerts */ NULL,
+ /* deformMatrices */ NULL,
+ /* deformVertsEM */ NULL,
+ /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier,
- /* applyModifierEM */ 0,
+ /* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
/* freeData */ freeData,
- /* isDisabled */ 0,
+ /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime,
- /* dependsOnNormals */ 0,
- /* foreachObjectLink */ 0,
+ /* dependsOnNormals */ NULL,
+ /* foreachObjectLink */ NULL,
/* foreachIDLink */ foreachIDLink,
/* foreachTexLink */ foreachTexLink,
};
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index 1baa03d2063..34c8c4cc1b1 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -69,7 +69,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
if(fluidmd)
{
FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
-
+
fluidmd->fss = fss;
if(!fss)
@@ -102,9 +102,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
// fluid/inflow settings
// fss->iniVel --> automatically set to 0
- /* elubie: changed this to default to the same dir as the render output
- to prevent saving to C:\ on Windows */
- BLI_strncpy(fss->surfdataPath, BLI_temporary_dir(), FILE_MAX);
+ modifier_path_init(fss->surfdataPath, sizeof(fss->surfdataPath), "fluid_cache");
// first init of bounding box
// no bounding box needed
@@ -445,11 +443,11 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
gzclose(gzf);
}
-static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams)
+static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams)
{
int displaymode = 0;
int curFrame = framenr - 1 /*scene->r.sfra*/; /* start with 0 at start frame */
- char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
+ char targetFile[FILE_MAXFILE+FILE_MAXDIR];
FluidsimSettings *fss = fluidmd->fss;
DerivedMesh *dm = NULL;
MFace *mface;
@@ -462,27 +460,22 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
displaymode = fss->renderDisplayMode;
}
- BLI_strncpy(targetDir, fss->surfdataPath, sizeof(targetDir));
-
- // use preview or final mesh?
- if(displaymode==1)
- {
- // just display original object
+ switch (displaymode) {
+ case 1:
+ /* just display original object */
return NULL;
+ case 2:
+ /* use preview mesh */
+ BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME);
+ break;
+ default: /* 3 */
+ /* 3. use final mesh */
+ BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME);
+ break;
}
- else if(displaymode==2)
- {
- strcat(targetDir,"fluidsurface_preview_####");
- }
- else
- { // 3
- strcat(targetDir,"fluidsurface_final_####");
- }
-
- BLI_path_abs(targetDir, G.main->name);
- BLI_path_frame(targetDir, curFrame, 0); // fixed #frame-no
- BLI_snprintf(targetFile, sizeof(targetFile), "%s.bobj.gz", targetDir);
+ BLI_path_abs(targetFile, modifier_path_relbase(ob));
+ BLI_path_frame(targetFile, curFrame, 0); // fixed #frame-no
dm = fluidsim_read_obj(targetFile);
@@ -538,7 +531,7 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
#endif // WITH_MOD_FLUID
DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
- Object *UNUSED(ob),
+ Object *ob,
DerivedMesh *dm,
int useRenderParams, int UNUSED(isFinalCalc))
{
@@ -571,7 +564,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
/* try to read from cache */
/* if the frame is there, fine, otherwise don't do anything */
- if((result = fluidsim_read_cache(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_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
new file mode 100644
index 00000000000..3ba49f26449
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -0,0 +1,565 @@
+/**
+ * ***** 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) Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_customdata_types.h"
+#include "DNA_object_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_cdderivedmesh.h"
+#include "BKE_global.h"
+#include "BKE_modifier.h"
+#include "BKE_ocean.h"
+#include "BKE_utildefines.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+#include "BLI_math_inline.h"
+#include "BLI_utildefines.h"
+#include "BLI_string.h"
+
+#include "MOD_util.h"
+
+#ifdef WITH_OCEANSIM
+static void init_cache_data(Object *ob, struct OceanModifierData *omd)
+{
+ const char *relbase= modifier_path_relbase(ob);
+
+ omd->oceancache = BKE_init_ocean_cache(omd->cachepath, relbase,
+ omd->bakestart, omd->bakeend, omd->wave_scale,
+ omd->chop_amount, omd->foam_coverage, omd->foam_fade, omd->resolution);
+}
+
+static void clear_cache_data(struct OceanModifierData *omd)
+{
+ BKE_free_ocean_cache(omd->oceancache);
+ omd->oceancache = NULL;
+ omd->cached = FALSE;
+}
+
+/* keep in sync with init_ocean_modifier_bake(), object_modifier.c */
+static void init_ocean_modifier(struct OceanModifierData *omd)
+{
+ int do_heightfield, do_chop, do_normals, do_jacobian;
+
+ if (!omd || !omd->ocean) return;
+
+ do_heightfield = TRUE;
+ do_chop = (omd->chop_amount > 0);
+ do_normals = (omd->flag & MOD_OCEAN_GENERATE_NORMALS);
+ do_jacobian = (omd->flag & MOD_OCEAN_GENERATE_FOAM);
+
+ BKE_free_ocean_data(omd->ocean);
+ BKE_init_ocean(omd->ocean, omd->resolution*omd->resolution, omd->resolution*omd->resolution, omd->spatial_size, omd->spatial_size,
+ omd->wind_velocity, omd->smallest_wave, 1.0, omd->wave_direction, omd->damp, omd->wave_alignment,
+ omd->depth, omd->time,
+ do_heightfield, do_chop, do_normals, do_jacobian,
+ omd->seed);
+}
+
+static void simulate_ocean_modifier(struct OceanModifierData *omd)
+{
+ if (!omd || !omd->ocean) return;
+
+ BKE_simulate_ocean(omd->ocean, omd->time, omd->wave_scale, omd->chop_amount);
+}
+#endif // WITH_OCEANSIM
+
+
+
+/* Modifier Code */
+
+static void initData(ModifierData *md)
+{
+#ifdef WITH_OCEANSIM
+ OceanModifierData *omd = (OceanModifierData*) md;
+
+ omd->resolution = 7;
+ omd->spatial_size = 50;
+
+ omd->wave_alignment = 0.0;
+ omd->wind_velocity = 30.0;
+
+ omd->damp = 0.5;
+ omd->smallest_wave = 0.01;
+ omd->wave_direction= 0.0;
+ omd->depth = 200.0;
+
+ omd->wave_scale = 1.0;
+
+ omd->chop_amount = 1.0;
+
+ omd->foam_coverage = 0.0;
+
+ omd->seed = 0;
+ omd->time = 1.0;
+
+ omd->refresh = 0;
+
+ omd->size = 1.0;
+ omd->repeat_x = 1;
+ omd->repeat_y = 1;
+
+ modifier_path_init(omd->cachepath, sizeof(omd->cachepath), "ocean_cache");
+
+ omd->cached = 0;
+ omd->bakestart = 1;
+ omd->bakeend = 250;
+ omd->oceancache = NULL;
+ omd->foam_fade = 0.98;
+ omd->foamlayername[0] = '\0'; /* layer name empty by default */
+
+ omd->ocean = BKE_add_ocean();
+ init_ocean_modifier(omd);
+ simulate_ocean_modifier(omd);
+#else // WITH_OCEANSIM
+ /* unused */
+ (void)md;
+#endif // WITH_OCEANSIM
+}
+
+static void freeData(ModifierData *md)
+{
+#ifdef WITH_OCEANSIM
+ OceanModifierData *omd = (OceanModifierData*) md;
+
+ BKE_free_ocean(omd->ocean);
+ if (omd->oceancache)
+ BKE_free_ocean_cache(omd->oceancache);
+#else // WITH_OCEANSIM
+ /* unused */
+ (void)md;
+#endif // WITH_OCEANSIM
+}
+
+static void copyData(ModifierData *md, ModifierData *target)
+{
+#ifdef WITH_OCEANSIM
+ OceanModifierData *omd = (OceanModifierData*) md;
+ OceanModifierData *tomd = (OceanModifierData*) target;
+
+ tomd->resolution = omd->resolution;
+ tomd->spatial_size = omd->spatial_size;
+
+ tomd->wind_velocity = omd->wind_velocity;
+
+ tomd->damp = omd->damp;
+ tomd->smallest_wave = omd->smallest_wave;
+ tomd->depth = omd->depth;
+
+ tomd->wave_alignment = omd->wave_alignment;
+ tomd->wave_direction = omd->wave_direction;
+ tomd->wave_scale = omd->wave_scale;
+
+ tomd->chop_amount = omd->chop_amount;
+ tomd->foam_coverage = omd->foam_coverage;
+ tomd->time = omd->time;
+
+ tomd->seed = omd->seed;
+ tomd->flag = omd->flag;
+
+ tomd->refresh = 0;
+
+
+ tomd->size = omd->size;
+ tomd->repeat_x = omd->repeat_x;
+ tomd->repeat_y = omd->repeat_y;
+
+ /* XXX todo: copy cache runtime too */
+ tomd->cached = 0;
+ tomd->bakestart = omd->bakestart;
+ tomd->bakeend = omd->bakeend;
+ tomd->oceancache = NULL;
+
+ tomd->ocean = BKE_add_ocean();
+ init_ocean_modifier(tomd);
+ simulate_ocean_modifier(tomd);
+#else // WITH_OCEANSIM
+ /* unused */
+ (void)md;
+ (void)target;
+#endif // WITH_OCEANSIM
+}
+
+#ifdef WITH_OCEANSIM
+static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
+{
+ OceanModifierData *omd = (OceanModifierData *)md;
+ CustomDataMask dataMask = 0;
+
+ if (omd->flag & MOD_OCEAN_GENERATE_FOAM)
+ dataMask |= CD_MASK_MCOL;
+
+ return dataMask;
+}
+#else // WITH_OCEANSIM
+static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
+{
+ /* unused */
+ (void)md;
+ return 0;
+}
+#endif // WITH_OCEANSIM
+
+#if 0
+static void dm_get_bounds(DerivedMesh *dm, float *sx, float *sy, float *ox, float *oy)
+{
+ /* get bounding box of underlying dm */
+ int v, totvert=dm->getNumVerts(dm);
+ float min[3], max[3], delta[3];
+
+ MVert *mvert = dm->getVertDataArray(dm,0);
+
+ copy_v3_v3(min, mvert->co);
+ copy_v3_v3(max, mvert->co);
+
+ 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]);
+
+ max[0]=MAX2(max[0],mvert->co[0]);
+ max[1]=MAX2(max[1],mvert->co[1]);
+ max[2]=MAX2(max[2],mvert->co[2]);
+ }
+
+ sub_v3_v3v3(delta, max, min);
+
+ *sx = delta[0];
+ *sy = delta[1];
+
+ *ox = min[0];
+ *oy = min[1];
+}
+#endif
+
+#ifdef WITH_OCEANSIM
+MINLINE float ocean_co(OceanModifierData *omd, float v)
+{
+ //float scale = 1.0 / (omd->size * omd->spatial_size);
+ //*v = (*v * scale) + 0.5;
+
+ return (v / (omd->size * omd->spatial_size)) + 0.5f;
+}
+
+#define OMP_MIN_RES 18
+static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
+{
+ DerivedMesh *result;
+
+ MVert *mv;
+ MFace *mf;
+ MTFace *tf;
+
+ int cdlayer;
+
+ const int rx = omd->resolution*omd->resolution;
+ const int ry = omd->resolution*omd->resolution;
+ const int res_x = rx * omd->repeat_x;
+ const int res_y = ry * omd->repeat_y;
+
+ const int num_verts = (res_x + 1) * (res_y + 1);
+ const int num_edges = (res_x * res_y * 2) + res_x + res_y;
+ const int num_faces = res_x * res_y;
+
+ float sx = omd->size * omd->spatial_size;
+ float sy = omd->size * omd->spatial_size;
+ const float ox = -sx / 2.0f;
+ const float oy = -sy / 2.0f;
+
+ float ix, iy;
+
+ int x, y;
+
+ sx /= rx;
+ sy /= ry;
+
+ result = CDDM_new(num_verts, num_edges, num_faces);
+
+ mv = CDDM_get_verts(result);
+ mf = CDDM_get_faces(result);
+
+ /* create vertices */
+ #pragma omp parallel for private(x, y) if (rx > OMP_MIN_RES)
+ for (y=0; y < res_y+1; y++) {
+ for (x=0; x < res_x+1; x++) {
+ const int i = y*(res_x+1) + x;
+ mv[i].co[0] = ox + (x * sx);
+ mv[i].co[1] = oy + (y * sy);
+ mv[i].co[2] = 0;
+ }
+ }
+
+ /* create faces */
+ #pragma omp parallel for private(x, y) if (rx > OMP_MIN_RES)
+ for (y=0; y < res_y; y++) {
+ for (x=0; x < res_x; x++) {
+ const int fi = y*res_x + x;
+ const int vi = y*(res_x+1) + x;
+ mf[fi].v1 = vi;
+ mf[fi].v2 = vi + 1;
+ mf[fi].v3 = vi + 1 + res_x+1;
+ mf[fi].v4 = vi + res_x+1;
+
+ mf[fi].flag |= ME_SMOOTH;
+ }
+ }
+
+ CDDM_calc_edges(result);
+
+ /* add uvs */
+ cdlayer= CustomData_number_of_layers(&result->faceData, CD_MTFACE);
+ if(cdlayer >= MAX_MTFACE)
+ return result;
+ CustomData_add_layer(&result->faceData, CD_MTFACE, CD_CALLOC, NULL, num_faces);
+ tf = CustomData_get_layer(&result->faceData, CD_MTFACE);
+
+ ix = 1.0 / rx;
+ iy = 1.0 / ry;
+ #pragma omp parallel for private(x, y) if (rx > OMP_MIN_RES)
+ for (y=0; y < res_y; y++) {
+ for (x=0; x < res_x; x++) {
+ const int i = y*res_x + x;
+ tf[i].uv[0][0] = x * ix;
+ tf[i].uv[0][1] = y * iy;
+
+ tf[i].uv[1][0] = (x+1) * ix;
+ tf[i].uv[1][1] = y * iy;
+
+ tf[i].uv[2][0] = (x+1) * ix;
+ tf[i].uv[2][1] = (y+1) * iy;
+
+ tf[i].uv[3][0] = x * ix;
+ tf[i].uv[3][1] = (y+1) * iy;
+ }
+ }
+
+ return result;
+}
+
+static DerivedMesh *doOcean(ModifierData *md, Object *ob,
+ DerivedMesh *derivedData,
+ int UNUSED(useRenderParams))
+{
+ OceanModifierData *omd = (OceanModifierData*) md;
+
+ DerivedMesh *dm=NULL;
+ OceanResult ocr;
+
+ MVert *mv;
+ MFace *mf;
+
+ int cdlayer;
+
+ int i, j;
+
+ int num_verts;
+ int num_faces;
+
+ int cfra;
+
+ /* update modifier */
+ if (omd->refresh & MOD_OCEAN_REFRESH_ADD)
+ omd->ocean = BKE_add_ocean();
+ if (omd->refresh & MOD_OCEAN_REFRESH_RESET)
+ init_ocean_modifier(omd);
+ if (omd->refresh & MOD_OCEAN_REFRESH_CLEAR_CACHE)
+ clear_cache_data(omd);
+
+ omd->refresh = 0;
+
+ /* do ocean simulation */
+ if (omd->cached == TRUE) {
+ if (!omd->oceancache) init_cache_data(ob, omd);
+ BKE_simulate_ocean_cache(omd->oceancache, md->scene->r.cfra);
+ } else {
+ simulate_ocean_modifier(omd);
+ }
+
+ if (omd->geometry_mode == MOD_OCEAN_GEOM_GENERATE)
+ dm = generate_ocean_geometry(omd);
+ else if (omd->geometry_mode == MOD_OCEAN_GEOM_DISPLACE) {
+ dm = CDDM_copy(derivedData);
+ }
+
+ cfra = md->scene->r.cfra;
+ CLAMP(cfra, omd->bakestart, omd->bakeend);
+ cfra -= omd->bakestart; // shift to 0 based
+
+ num_verts = dm->getNumVerts(dm);
+ num_faces = dm->getNumFaces(dm);
+
+ /* add vcols before displacement - allows lookup based on position */
+
+ if (omd->flag & MOD_OCEAN_GENERATE_FOAM) {
+ MCol *mc;
+ float foam;
+ char cf;
+
+ float u=0.0, v=0.0;
+
+ cdlayer= CustomData_number_of_layers(&dm->faceData, CD_MCOL);
+ if(cdlayer >= MAX_MCOL)
+ return dm;
+
+ CustomData_add_layer_named(&dm->faceData, CD_MCOL, CD_CALLOC, NULL, num_faces, omd->foamlayername);
+
+ mc = dm->getFaceDataArray(dm, CD_MCOL);
+ mv = dm->getVertArray(dm);
+ mf = dm->getFaceArray(dm);
+
+ for (i = 0; i < num_faces; i++, mf++) {
+ for (j=0; j<4; j++) {
+
+ if (j == 3 && !mf->v4) continue;
+
+ switch(j) {
+ case 0:
+ u = ocean_co(omd, mv[mf->v1].co[0]);
+ v = ocean_co(omd, mv[mf->v1].co[1]);
+ break;
+ case 1:
+ u = ocean_co(omd, mv[mf->v2].co[0]);
+ v = ocean_co(omd, mv[mf->v2].co[1]);
+ break;
+ case 2:
+ u = ocean_co(omd, mv[mf->v3].co[0]);
+ v = ocean_co(omd, mv[mf->v3].co[1]);
+ break;
+ case 3:
+ u = ocean_co(omd, mv[mf->v4].co[0]);
+ v = ocean_co(omd, mv[mf->v4].co[1]);
+
+ break;
+ }
+
+ if (omd->oceancache && omd->cached==TRUE) {
+ BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra, u, v);
+ foam = ocr.foam;
+ CLAMP(foam, 0.0f, 1.0f);
+ } else {
+ BKE_ocean_eval_uv(omd->ocean, &ocr, u, v);
+ foam = BKE_ocean_jminus_to_foam(ocr.Jminus, omd->foam_coverage);
+ }
+
+ cf = (char)(foam*255);
+ mc[i*4 + j].r = mc[i*4 + j].g = mc[i*4 + j].b = cf;
+ mc[i*4 + j].a = 255;
+ }
+ }
+ }
+
+
+ /* displace the geometry */
+
+ mv = dm->getVertArray(dm);
+
+ //#pragma omp parallel for private(i, ocr) if (omd->resolution > OMP_MIN_RES)
+ for (i=0; i< num_verts; i++) {
+ const float u = ocean_co(omd, mv[i].co[0]);
+ const float v = ocean_co(omd, mv[i].co[1]);
+
+ if (omd->oceancache && omd->cached==TRUE)
+ BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra, u, v);
+ else
+ BKE_ocean_eval_uv(omd->ocean, &ocr, u, v);
+
+ mv[i].co[2] += ocr.disp[1];
+
+ if (omd->chop_amount > 0.0f) {
+ mv[i].co[0] += ocr.disp[0];
+ mv[i].co[1] += ocr.disp[2];
+ }
+ }
+
+
+ return dm;
+}
+#else // WITH_OCEANSIM
+static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob),
+ DerivedMesh *derivedData,
+ int UNUSED(useRenderParams))
+{
+ /* unused */
+ (void)md;
+ return derivedData;
+}
+#endif // WITH_OCEANSIM
+
+static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
+ DerivedMesh *derivedData,
+ int UNUSED(useRenderParams),
+ int UNUSED(isFinalCalc))
+{
+ DerivedMesh *result;
+
+ result = doOcean(md, ob, derivedData, 0);
+
+ if(result != derivedData)
+ CDDM_calc_normals(result);
+
+ return result;
+}
+
+static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
+ struct EditMesh *UNUSED(editData),
+ DerivedMesh *derivedData)
+{
+ return applyModifier(md, ob, derivedData, 0, 1);
+}
+
+
+
+ModifierTypeInfo modifierType_Ocean = {
+ /* name */ "Ocean",
+ /* structName */ "OceanModifierData",
+ /* structSize */ sizeof(OceanModifierData),
+ /* type */ eModifierTypeType_Constructive,
+ /* flags */ eModifierTypeFlag_AcceptsMesh
+ | eModifierTypeFlag_SupportsEditmode
+ | eModifierTypeFlag_EnableInEditmode,
+
+ /* copyData */ copyData,
+ /* deformMatrices */ NULL,
+ /* deformVerts */ NULL,
+ /* deformVertsEM */ NULL,
+ /* deformMatricesEM */ NULL,
+ /* applyModifier */ applyModifier,
+ /* applyModifierEM */ applyModifierEM,
+ /* initData */ initData,
+ /* requiredDataMask */ requiredDataMask,
+ /* freeData */ freeData,
+ /* isDisabled */ NULL,
+ /* updateDepgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* dependsOnNormals */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL,
+};
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 38abb96aa7c..01c7f31b67a 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -260,6 +260,7 @@ void modifier_type_init(ModifierTypeInfo *types[])
INIT_TYPE(Collision);
INIT_TYPE(Boolean);
INIT_TYPE(MeshDeform);
+ INIT_TYPE(Ocean);
INIT_TYPE(ParticleSystem);
INIT_TYPE(ParticleInstance);
INIT_TYPE(Explode);
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index df528a0cb11..e3abc16f98f 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -46,6 +46,7 @@
#include "BLI_utildefines.h"
+#include "BKE_camera.h"
#include "BKE_DerivedMesh.h"
#include "MOD_modifiertypes.h"
@@ -195,20 +196,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
free_uci= 1;
}
else {
- float sensor= (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : cam->sensor_x;
+ float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
+ int sensor_fit= camera_sensor_fit(cam->sensor_fit, aspx, aspy);
float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale;
float xmax, xmin, ymax, ymin;
- if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
- if(aspect > 1.0f) {
- xmax = 0.5f * scale;
- ymax = xmax / aspect;
- } else {
- ymax = 0.5f * scale;
- xmax = ymax * aspect;
- }
- }
- else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+ if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
xmax = 0.5f * scale;
ymax = xmax / aspect;
}
diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h
index 6deea004417..b74342ab516 100644
--- a/source/blender/nodes/NOD_composite.h
+++ b/source/blender/nodes/NOD_composite.h
@@ -42,84 +42,84 @@ extern bNodeTreeType ntreeType_Composite;
/* ****************** types array for all composite nodes ****************** */
-void register_node_type_cmp_group(ListBase *lb);
-void register_node_type_cmp_forloop(ListBase *lb);
-void register_node_type_cmp_whileloop(ListBase *lb);
-
-void register_node_type_cmp_rlayers(ListBase *lb);
-void register_node_type_cmp_image(ListBase *lb);
-void register_node_type_cmp_texture(ListBase *lb);
-void register_node_type_cmp_value(ListBase *lb);
-void register_node_type_cmp_rgb(ListBase *lb);
-void register_node_type_cmp_curve_time(ListBase *lb);
-void register_node_type_cmp_movieclip(ListBase *lb);
-
-void register_node_type_cmp_composite(ListBase *lb);
-void register_node_type_cmp_viewer(ListBase *lb);
-void register_node_type_cmp_splitviewer(ListBase *lb);
-void register_node_type_cmp_output_file(ListBase *lb);
-void register_node_type_cmp_view_levels(ListBase *lb);
-
-void register_node_type_cmp_curve_rgb(ListBase *lb);
-void register_node_type_cmp_mix_rgb(ListBase *lb);
-void register_node_type_cmp_hue_sat(ListBase *lb);
-void register_node_type_cmp_brightcontrast(ListBase *lb);
-void register_node_type_cmp_gamma(ListBase *lb);
-void register_node_type_cmp_invert(ListBase *lb);
-void register_node_type_cmp_alphaover(ListBase *lb);
-void register_node_type_cmp_zcombine(ListBase *lb);
-void register_node_type_cmp_colorbalance(ListBase *lb);
-void register_node_type_cmp_huecorrect(ListBase *lb);
-
-void register_node_type_cmp_normal(ListBase *lb);
-void register_node_type_cmp_curve_vec(ListBase *lb);
-void register_node_type_cmp_map_value(ListBase *lb);
-void register_node_type_cmp_normalize(ListBase *lb);
-
-void register_node_type_cmp_filter(ListBase *lb);
-void register_node_type_cmp_blur(ListBase *lb);
-void register_node_type_cmp_dblur(ListBase *lb);
-void register_node_type_cmp_bilateralblur(ListBase *lb);
-void register_node_type_cmp_vecblur(ListBase *lb);
-void register_node_type_cmp_dilateerode(ListBase *lb);
-void register_node_type_cmp_defocus(ListBase *lb);
-
-void register_node_type_cmp_valtorgb(ListBase *lb);
-void register_node_type_cmp_rgbtobw(ListBase *lb);
-void register_node_type_cmp_setalpha(ListBase *lb);
-void register_node_type_cmp_idmask(ListBase *lb);
-void register_node_type_cmp_math(ListBase *lb);
-void register_node_type_cmp_seprgba(ListBase *lb);
-void register_node_type_cmp_combrgba(ListBase *lb);
-void register_node_type_cmp_sephsva(ListBase *lb);
-void register_node_type_cmp_combhsva(ListBase *lb);
-void register_node_type_cmp_sepyuva(ListBase *lb);
-void register_node_type_cmp_combyuva(ListBase *lb);
-void register_node_type_cmp_sepycca(ListBase *lb);
-void register_node_type_cmp_combycca(ListBase *lb);
-void register_node_type_cmp_premulkey(ListBase *lb);
-
-void register_node_type_cmp_diff_matte(ListBase *lb);
-void register_node_type_cmp_distance_matte(ListBase *lb);
-void register_node_type_cmp_chroma_matte(ListBase *lb);
-void register_node_type_cmp_color_matte(ListBase *lb);
-void register_node_type_cmp_channel_matte(ListBase *lb);
-void register_node_type_cmp_color_spill(ListBase *lb);
-void register_node_type_cmp_luma_matte(ListBase *lb);
-
-void register_node_type_cmp_translate(ListBase *lb);
-void register_node_type_cmp_rotate(ListBase *lb);
-void register_node_type_cmp_scale(ListBase *lb);
-void register_node_type_cmp_flip(ListBase *lb);
-void register_node_type_cmp_crop(ListBase *lb);
-void register_node_type_cmp_displace(ListBase *lb);
-void register_node_type_cmp_mapuv(ListBase *lb);
-void register_node_type_cmp_transform(ListBase *lb);
-void register_node_type_cmp_stabilize2d(ListBase *lb);
-void register_node_type_cmp_moviedistortion(ListBase *lb);
-
-void register_node_type_cmp_glare(ListBase *lb);
-void register_node_type_cmp_tonemap(ListBase *lb);
-void register_node_type_cmp_lensdist(ListBase *lb);
+void register_node_type_cmp_group(struct bNodeTreeType *ttype);
+void register_node_type_cmp_forloop(struct bNodeTreeType *ttype);
+void register_node_type_cmp_whileloop(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_rlayers(struct bNodeTreeType *ttype);
+void register_node_type_cmp_image(struct bNodeTreeType *ttype);
+void register_node_type_cmp_texture(struct bNodeTreeType *ttype);
+void register_node_type_cmp_value(struct bNodeTreeType *ttype);
+void register_node_type_cmp_rgb(struct bNodeTreeType *ttype);
+void register_node_type_cmp_curve_time(struct bNodeTreeType *ttype);
+void register_node_type_cmp_movieclip(struct bNodeTreeType *ttype);
+
+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_view_levels(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_curve_rgb(struct bNodeTreeType *ttype);
+void register_node_type_cmp_mix_rgb(struct bNodeTreeType *ttype);
+void register_node_type_cmp_hue_sat(struct bNodeTreeType *ttype);
+void register_node_type_cmp_brightcontrast(struct bNodeTreeType *ttype);
+void register_node_type_cmp_gamma(struct bNodeTreeType *ttype);
+void register_node_type_cmp_invert(struct bNodeTreeType *ttype);
+void register_node_type_cmp_alphaover(struct bNodeTreeType *ttype);
+void register_node_type_cmp_zcombine(struct bNodeTreeType *ttype);
+void register_node_type_cmp_colorbalance(struct bNodeTreeType *ttype);
+void register_node_type_cmp_huecorrect(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_normal(struct bNodeTreeType *ttype);
+void register_node_type_cmp_curve_vec(struct bNodeTreeType *ttype);
+void register_node_type_cmp_map_value(struct bNodeTreeType *ttype);
+void register_node_type_cmp_normalize(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_filter(struct bNodeTreeType *ttype);
+void register_node_type_cmp_blur(struct bNodeTreeType *ttype);
+void register_node_type_cmp_dblur(struct bNodeTreeType *ttype);
+void register_node_type_cmp_bilateralblur(struct bNodeTreeType *ttype);
+void register_node_type_cmp_vecblur(struct bNodeTreeType *ttype);
+void register_node_type_cmp_dilateerode(struct bNodeTreeType *ttype);
+void register_node_type_cmp_defocus(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_valtorgb(struct bNodeTreeType *ttype);
+void register_node_type_cmp_rgbtobw(struct bNodeTreeType *ttype);
+void register_node_type_cmp_setalpha(struct bNodeTreeType *ttype);
+void register_node_type_cmp_idmask(struct bNodeTreeType *ttype);
+void register_node_type_cmp_math(struct bNodeTreeType *ttype);
+void register_node_type_cmp_seprgba(struct bNodeTreeType *ttype);
+void register_node_type_cmp_combrgba(struct bNodeTreeType *ttype);
+void register_node_type_cmp_sephsva(struct bNodeTreeType *ttype);
+void register_node_type_cmp_combhsva(struct bNodeTreeType *ttype);
+void register_node_type_cmp_sepyuva(struct bNodeTreeType *ttype);
+void register_node_type_cmp_combyuva(struct bNodeTreeType *ttype);
+void register_node_type_cmp_sepycca(struct bNodeTreeType *ttype);
+void register_node_type_cmp_combycca(struct bNodeTreeType *ttype);
+void register_node_type_cmp_premulkey(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_diff_matte(struct bNodeTreeType *ttype);
+void register_node_type_cmp_distance_matte(struct bNodeTreeType *ttype);
+void register_node_type_cmp_chroma_matte(struct bNodeTreeType *ttype);
+void register_node_type_cmp_color_matte(struct bNodeTreeType *ttype);
+void register_node_type_cmp_channel_matte(struct bNodeTreeType *ttype);
+void register_node_type_cmp_color_spill(struct bNodeTreeType *ttype);
+void register_node_type_cmp_luma_matte(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_translate(struct bNodeTreeType *ttype);
+void register_node_type_cmp_rotate(struct bNodeTreeType *ttype);
+void register_node_type_cmp_scale(struct bNodeTreeType *ttype);
+void register_node_type_cmp_flip(struct bNodeTreeType *ttype);
+void register_node_type_cmp_crop(struct bNodeTreeType *ttype);
+void register_node_type_cmp_displace(struct bNodeTreeType *ttype);
+void register_node_type_cmp_mapuv(struct bNodeTreeType *ttype);
+void register_node_type_cmp_transform(struct bNodeTreeType *ttype);
+void register_node_type_cmp_stabilize2d(struct bNodeTreeType *ttype);
+void register_node_type_cmp_moviedistortion(struct bNodeTreeType *ttype);
+
+void register_node_type_cmp_glare(struct bNodeTreeType *ttype);
+void register_node_type_cmp_tonemap(struct bNodeTreeType *ttype);
+void register_node_type_cmp_lensdist(struct bNodeTreeType *ttype);
#endif
diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h
index 996660fcb8b..293ce466574 100644
--- a/source/blender/nodes/NOD_shader.h
+++ b/source/blender/nodes/NOD_shader.h
@@ -43,68 +43,68 @@ extern struct bNodeTreeType ntreeType_Shader;
/* the type definitions array */
/* ****************** types array for all shaders ****************** */
-void register_node_type_sh_group(ListBase *lb);
-void register_node_type_sh_forloop(ListBase *lb);
-void register_node_type_sh_whileloop(ListBase *lb);
+void register_node_type_sh_group(struct bNodeTreeType *ttype);
+void register_node_type_sh_forloop(struct bNodeTreeType *ttype);
+void register_node_type_sh_whileloop(struct bNodeTreeType *ttype);
-void register_node_type_sh_output(ListBase *lb);
-void register_node_type_sh_material(ListBase *lb);
-void register_node_type_sh_camera(ListBase *lb);
-void register_node_type_sh_value(ListBase *lb);
-void register_node_type_sh_rgb(ListBase *lb);
-void register_node_type_sh_mix_rgb(ListBase *lb);
-void register_node_type_sh_valtorgb(ListBase *lb);
-void register_node_type_sh_rgbtobw(ListBase *lb);
-void register_node_type_sh_texture(ListBase *lb);
-void register_node_type_sh_normal(ListBase *lb);
-void register_node_type_sh_geom(ListBase *lb);
-void register_node_type_sh_mapping(ListBase *lb);
-void register_node_type_sh_curve_vec(ListBase *lb);
-void register_node_type_sh_curve_rgb(ListBase *lb);
-void register_node_type_sh_math(ListBase *lb);
-void register_node_type_sh_vect_math(ListBase *lb);
-void register_node_type_sh_squeeze(ListBase *lb);
-void register_node_type_sh_dynamic(ListBase *lb);
-void register_node_type_sh_material_ext(ListBase *lb);
-void register_node_type_sh_invert(ListBase *lb);
-void register_node_type_sh_seprgb(ListBase *lb);
-void register_node_type_sh_combrgb(ListBase *lb);
-void register_node_type_sh_hue_sat(ListBase *lb);
+void register_node_type_sh_output(struct bNodeTreeType *ttype);
+void register_node_type_sh_material(struct bNodeTreeType *ttype);
+void register_node_type_sh_camera(struct bNodeTreeType *ttype);
+void register_node_type_sh_value(struct bNodeTreeType *ttype);
+void register_node_type_sh_rgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_mix_rgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_valtorgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_rgbtobw(struct bNodeTreeType *ttype);
+void register_node_type_sh_texture(struct bNodeTreeType *ttype);
+void register_node_type_sh_normal(struct bNodeTreeType *ttype);
+void register_node_type_sh_geom(struct bNodeTreeType *ttype);
+void register_node_type_sh_mapping(struct bNodeTreeType *ttype);
+void register_node_type_sh_curve_vec(struct bNodeTreeType *ttype);
+void register_node_type_sh_curve_rgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_math(struct bNodeTreeType *ttype);
+void register_node_type_sh_vect_math(struct bNodeTreeType *ttype);
+void register_node_type_sh_squeeze(struct bNodeTreeType *ttype);
+void register_node_type_sh_dynamic(struct bNodeTreeType *ttype);
+void register_node_type_sh_material_ext(struct bNodeTreeType *ttype);
+void register_node_type_sh_invert(struct bNodeTreeType *ttype);
+void register_node_type_sh_seprgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_combrgb(struct bNodeTreeType *ttype);
+void register_node_type_sh_hue_sat(struct bNodeTreeType *ttype);
-void register_node_type_sh_attribute(ListBase *lb);
-void register_node_type_sh_geometry(ListBase *lb);
-void register_node_type_sh_light_path(ListBase *lb);
-void register_node_type_sh_fresnel(ListBase *lb);
-void register_node_type_sh_layer_weight(ListBase *lb);
-void register_node_type_sh_tex_coord(ListBase *lb);
+void register_node_type_sh_attribute(struct bNodeTreeType *ttype);
+void register_node_type_sh_geometry(struct bNodeTreeType *ttype);
+void register_node_type_sh_light_path(struct bNodeTreeType *ttype);
+void register_node_type_sh_fresnel(struct bNodeTreeType *ttype);
+void register_node_type_sh_layer_weight(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_coord(struct bNodeTreeType *ttype);
-void register_node_type_sh_background(ListBase *lb);
-void register_node_type_sh_bsdf_diffuse(ListBase *lb);
-void register_node_type_sh_bsdf_glossy(ListBase *lb);
-void register_node_type_sh_bsdf_glass(ListBase *lb);
-void register_node_type_sh_bsdf_translucent(ListBase *lb);
-void register_node_type_sh_bsdf_transparent(ListBase *lb);
-void register_node_type_sh_bsdf_velvet(ListBase *lb);
-void register_node_type_sh_emission(ListBase *lb);
-void register_node_type_sh_holdout(ListBase *lb);
-void register_node_type_sh_volume_transparent(ListBase *lb);
-void register_node_type_sh_volume_isotropic(ListBase *lb);
-void register_node_type_sh_mix_shader(ListBase *lb);
-void register_node_type_sh_add_shader(ListBase *lb);
+void register_node_type_sh_background(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_diffuse(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_glossy(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_glass(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_translucent(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_transparent(struct bNodeTreeType *ttype);
+void register_node_type_sh_bsdf_velvet(struct bNodeTreeType *ttype);
+void register_node_type_sh_emission(struct bNodeTreeType *ttype);
+void register_node_type_sh_holdout(struct bNodeTreeType *ttype);
+void register_node_type_sh_volume_transparent(struct bNodeTreeType *ttype);
+void register_node_type_sh_volume_isotropic(struct bNodeTreeType *ttype);
+void register_node_type_sh_mix_shader(struct bNodeTreeType *ttype);
+void register_node_type_sh_add_shader(struct bNodeTreeType *ttype);
-void register_node_type_sh_output_lamp(ListBase *lb);
-void register_node_type_sh_output_material(ListBase *lb);
-void register_node_type_sh_output_world(ListBase *lb);
+void register_node_type_sh_output_lamp(struct bNodeTreeType *ttype);
+void register_node_type_sh_output_material(struct bNodeTreeType *ttype);
+void register_node_type_sh_output_world(struct bNodeTreeType *ttype);
-void register_node_type_sh_tex_image(ListBase *lb);
-void register_node_type_sh_tex_environment(ListBase *lb);
-void register_node_type_sh_tex_sky(ListBase *lb);
-void register_node_type_sh_tex_voronoi(ListBase *lb);
-void register_node_type_sh_tex_gradient(ListBase *lb);
-void register_node_type_sh_tex_magic(ListBase *lb);
-void register_node_type_sh_tex_wave(ListBase *lb);
-void register_node_type_sh_tex_musgrave(ListBase *lb);
-void register_node_type_sh_tex_noise(ListBase *lb);
+void register_node_type_sh_tex_image(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_environment(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_sky(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_voronoi(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_gradient(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_magic(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_wave(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_musgrave(struct bNodeTreeType *ttype);
+void register_node_type_sh_tex_noise(struct bNodeTreeType *ttype);
#endif
diff --git a/source/blender/nodes/NOD_socket.h b/source/blender/nodes/NOD_socket.h
index 22efc99dfe8..6a6413d508f 100644
--- a/source/blender/nodes/NOD_socket.h
+++ b/source/blender/nodes/NOD_socket.h
@@ -62,6 +62,9 @@ struct bNodeSocket *nodeAddOutputVector(struct bNodeTree *ntree, struct bNode *n
struct bNodeSocket *nodeAddInputRGBA(struct bNodeTree *ntree, struct bNode *node, const char *name, float r, float g, float b, float a);
struct bNodeSocket *nodeAddOutputRGBA(struct bNodeTree *ntree, struct bNode *node, const char *name);
+struct bNodeSocket *nodeAddInputShader(struct bNodeTree *ntree, struct bNode *node, const char *name);
+struct bNodeSocket *nodeAddOutputShader(struct bNodeTree *ntree, struct bNode *node, const char *name);
+
struct bNodeSocket *nodeAddInputMesh(struct bNodeTree *ntree, struct bNode *node, const char *name);
struct bNodeSocket *nodeAddOutputMesh(struct bNodeTree *ntree, struct bNode *node, const char *name);
diff --git a/source/blender/nodes/NOD_texture.h b/source/blender/nodes/NOD_texture.h
index b07c0b22b75..b3fdbf0e250 100644
--- a/source/blender/nodes/NOD_texture.h
+++ b/source/blender/nodes/NOD_texture.h
@@ -42,45 +42,45 @@ extern bNodeTreeType ntreeType_Texture;
/* ****************** types array for all texture nodes ****************** */
-void register_node_type_tex_group(ListBase *lb);
-void register_node_type_tex_forloop(ListBase *lb);
-void register_node_type_tex_whileloop(ListBase *lb);
+void register_node_type_tex_group(struct bNodeTreeType *ttype);
+void register_node_type_tex_forloop(struct bNodeTreeType *ttype);
+void register_node_type_tex_whileloop(struct bNodeTreeType *ttype);
-void register_node_type_tex_math(ListBase *lb);
-void register_node_type_tex_mix_rgb(ListBase *lb);
-void register_node_type_tex_valtorgb(ListBase *lb);
-void register_node_type_tex_valtonor(ListBase *lb);
-void register_node_type_tex_rgbtobw(ListBase *lb);
-void register_node_type_tex_output(ListBase *lb);
-void register_node_type_tex_viewer(ListBase *lb);
-void register_node_type_tex_checker(ListBase *lb);
-void register_node_type_tex_texture(ListBase *lb);
-void register_node_type_tex_bricks(ListBase *lb);
-void register_node_type_tex_image(ListBase *lb);
-void register_node_type_tex_curve_rgb(ListBase *lb);
-void register_node_type_tex_curve_time(ListBase *lb);
-void register_node_type_tex_invert(ListBase *lb);
-void register_node_type_tex_hue_sat(ListBase *lb);
-void register_node_type_tex_coord(ListBase *lb);
-void register_node_type_tex_distance(ListBase *lb);
+void register_node_type_tex_math(struct bNodeTreeType *ttype);
+void register_node_type_tex_mix_rgb(struct bNodeTreeType *ttype);
+void register_node_type_tex_valtorgb(struct bNodeTreeType *ttype);
+void register_node_type_tex_valtonor(struct bNodeTreeType *ttype);
+void register_node_type_tex_rgbtobw(struct bNodeTreeType *ttype);
+void register_node_type_tex_output(struct bNodeTreeType *ttype);
+void register_node_type_tex_viewer(struct bNodeTreeType *ttype);
+void register_node_type_tex_checker(struct bNodeTreeType *ttype);
+void register_node_type_tex_texture(struct bNodeTreeType *ttype);
+void register_node_type_tex_bricks(struct bNodeTreeType *ttype);
+void register_node_type_tex_image(struct bNodeTreeType *ttype);
+void register_node_type_tex_curve_rgb(struct bNodeTreeType *ttype);
+void register_node_type_tex_curve_time(struct bNodeTreeType *ttype);
+void register_node_type_tex_invert(struct bNodeTreeType *ttype);
+void register_node_type_tex_hue_sat(struct bNodeTreeType *ttype);
+void register_node_type_tex_coord(struct bNodeTreeType *ttype);
+void register_node_type_tex_distance(struct bNodeTreeType *ttype);
-void register_node_type_tex_rotate(ListBase *lb);
-void register_node_type_tex_translate(ListBase *lb);
-void register_node_type_tex_scale(ListBase *lb);
-void register_node_type_tex_at(ListBase *lb);
+void register_node_type_tex_rotate(struct bNodeTreeType *ttype);
+void register_node_type_tex_translate(struct bNodeTreeType *ttype);
+void register_node_type_tex_scale(struct bNodeTreeType *ttype);
+void register_node_type_tex_at(struct bNodeTreeType *ttype);
-void register_node_type_tex_compose(ListBase *lb);
-void register_node_type_tex_decompose(ListBase *lb);
+void register_node_type_tex_compose(struct bNodeTreeType *ttype);
+void register_node_type_tex_decompose(struct bNodeTreeType *ttype);
-void register_node_type_tex_proc_voronoi(ListBase *lb);
-void register_node_type_tex_proc_blend(ListBase *lb);
-void register_node_type_tex_proc_magic(ListBase *lb);
-void register_node_type_tex_proc_marble(ListBase *lb);
-void register_node_type_tex_proc_clouds(ListBase *lb);
-void register_node_type_tex_proc_wood(ListBase *lb);
-void register_node_type_tex_proc_musgrave(ListBase *lb);
-void register_node_type_tex_proc_noise(ListBase *lb);
-void register_node_type_tex_proc_stucci(ListBase *lb);
-void register_node_type_tex_proc_distnoise(ListBase *lb);
+void register_node_type_tex_proc_voronoi(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_blend(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_magic(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_marble(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_clouds(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_wood(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_musgrave(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_noise(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_stucci(struct bNodeTreeType *ttype);
+void register_node_type_tex_proc_distnoise(struct bNodeTreeType *ttype);
#endif
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 1a1d744fb1b..d6a1c50162b 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -228,7 +228,11 @@ bNodeTreeType ntreeType_Composite = {
/* local_sync */ local_sync,
/* local_merge */ local_merge,
/* update */ update,
- /* update_node */ update_node
+ /* update_node */ update_node,
+ /* validate_link */ NULL,
+ /* mutefunc */ node_compo_pass_on,
+ /* mutelinksfunc */ node_mute_get_links,
+ /* gpumutefunc */ NULL
};
@@ -356,13 +360,8 @@ static void *exec_composite_node(void *nodeexec_v)
node_get_stack(node, thd->stack, nsin, nsout);
- if((node->flag & NODE_MUTED) && (!node_only_value(node))) {
- /* viewers we execute, for feedback to user */
- if(ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
- else
- node_compo_pass_on(node, nsin, nsout);
- }
+ if((node->flag & NODE_MUTED) && node->typeinfo->mutefunc)
+ node->typeinfo->mutefunc(thd->rd, 0, node, nodeexec->data, nsin, nsout);
else if(node->typeinfo->execfunc)
node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
else if (node->typeinfo->newexecfunc)
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index ddd55790436..99a36691b10 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -131,44 +131,29 @@ void compbuf_set_node(CompBuf *cbuf, bNode *node)
}
/* used for disabling node (similar code in node_draw.c for disable line and node_edit for untangling nodes) */
-void node_compo_pass_on(bNode *node, bNodeStack **nsin, bNodeStack **nsout)
+void node_compo_pass_on(void *UNUSED(data), int UNUSED(thread), struct bNode *node, void *UNUSED(nodedata),
+ struct bNodeStack **in, struct bNodeStack **out)
{
- CompBuf *valbuf= NULL, *colbuf= NULL, *vecbuf= NULL;
- bNodeSocket *sock;
- int a;
-
- /* connect the first value buffer in with first value out */
- /* connect the first RGBA buffer in with first RGBA out */
-
- /* test the inputs */
- for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
- if(nsin[a]->data) {
- CompBuf *cbuf= nsin[a]->data;
- if(cbuf->type==1 && valbuf==NULL) valbuf= cbuf;
- if(cbuf->type==3 && vecbuf==NULL) vecbuf= cbuf;
- if(cbuf->type==4 && colbuf==NULL) colbuf= cbuf;
- }
- }
-
- /* outputs */
- if(valbuf || colbuf || vecbuf) {
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(nsout[a]->hasoutput) {
- if(sock->type==SOCK_FLOAT && valbuf) {
- nsout[a]->data= pass_on_compbuf(valbuf);
- valbuf= NULL;
- }
- if(sock->type==SOCK_VECTOR && vecbuf) {
- nsout[a]->data= pass_on_compbuf(vecbuf);
- vecbuf= NULL;
- }
- if(sock->type==SOCK_RGBA && colbuf) {
- nsout[a]->data= pass_on_compbuf(colbuf);
- colbuf= NULL;
- }
- }
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
+ int i;
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return;
+
+ /* Get default muting links (as bNodeStack pointers). */
+ links = node->typeinfo->mutelinksfunc(NULL, node, in, out, NULL, NULL);
+
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ for(i = 0; i < lnk->num_outs; i++) {
+ if(((bNodeStack*)(lnk->in))->data)
+ (((bNodeStack*)(lnk->outs))+i)->data = pass_on_compbuf((CompBuf*)((bNodeStack*)(lnk->in))->data);
}
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(i > 1)
+ MEM_freeN(lnk->outs);
}
+ BLI_freelistN(&links);
}
diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h
index 9cac4c477eb..bb606f4202e 100644
--- a/source/blender/nodes/composite/node_composite_util.h
+++ b/source/blender/nodes/composite/node_composite_util.h
@@ -124,7 +124,7 @@ CompBuf *pass_on_compbuf(CompBuf *cbuf);
void free_compbuf(CompBuf *cbuf);
void print_compbuf(char *str, CompBuf *cbuf);
void compbuf_set_node(struct CompBuf *cbuf, struct bNode *node);
-void node_compo_pass_on(struct bNode *node, struct bNodeStack **nsin, struct bNodeStack **nsout);
+void node_compo_pass_on(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out);
CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type);
CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy);
diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
index 4fd4b750178..cad85d33a66 100644
--- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
+++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
@@ -143,19 +143,16 @@ static void node_alphaover_init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemp
node->storage= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
}
-void register_node_type_cmp_alphaover(ListBase *lb)
+void register_node_type_cmp_alphaover(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_ALPHAOVER, "AlphaOver", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_ALPHAOVER, "AlphaOver", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_alphaover_in, cmp_node_alphaover_out);
node_type_size(&ntype, 80, 40, 120);
node_type_init(&ntype, node_alphaover_init);
node_type_storage(&ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_alphaover);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
index 0f341335783..c6462e2870c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
@@ -258,17 +258,16 @@ static void node_composit_init_bilateralblur(bNodeTree *UNUSED(ntree), bNode* no
nbbd->sigma_space= 5.0;
}
-void register_node_type_cmp_bilateralblur(ListBase *lb)
+void register_node_type_cmp_bilateralblur(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_bilateralblur_in, cmp_node_bilateralblur_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_bilateralblur);
node_type_storage(&ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_bilateralblur);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c
index 816aacbe61c..76827f719f5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_blur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_blur.c
@@ -716,19 +716,16 @@ static void node_composit_init_blur(bNodeTree *UNUSED(ntree), bNode* node, bNode
node->storage= MEM_callocN(sizeof(NodeBlurData), "node blur data");
}
-void register_node_type_cmp_blur(ListBase *lb)
+void register_node_type_cmp_blur(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_BLUR, "Blur", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_BLUR, "Blur", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_blur_in, cmp_node_blur_out);
node_type_size(&ntype, 120, 80, 200);
node_type_init(&ntype, node_composit_init_blur);
node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_blur);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c
index 9153e3899fc..d935d9af7f7 100644
--- a/source/blender/nodes/composite/nodes/node_composite_brightness.c
+++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c
@@ -94,15 +94,14 @@ static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, b
}
}
-void register_node_type_cmp_brightcontrast(ListBase *lb)
+void register_node_type_cmp_brightcontrast(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_brightcontrast_in, cmp_node_brightcontrast_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_brightcontrast);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
index 6597ceaeee2..785786dacbe 100644
--- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
@@ -200,16 +200,16 @@ static void node_composit_init_channel_matte(bNodeTree *UNUSED(ntree), bNode* no
node->custom2= 2; /* Green Channel */
}
-void register_node_type_cmp_channel_matte(ListBase *lb)
+void register_node_type_cmp_channel_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_CHANNEL_MATTE, "Channel Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_CHANNEL_MATTE, "Channel Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_channel_matte_in, cmp_node_channel_matte_out);
node_type_size(&ntype, 200, 80, 250);
node_type_init(&ntype, node_composit_init_channel_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_channel_matte);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
index 9aadfdf363b..b6f490a0320 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
@@ -102,7 +102,7 @@ static void do_chroma_key(bNode *node, float *out, float *in)
z=in[2]*cosf(theta)-in[1]*sinf(theta);
/*if within the acceptance angle */
- angle=c->t1*(float)M_PI/180.0f; /* convert to radians */
+ angle=c->t1; /* t1 is radians. */
/* if kfg is <0 then the pixel is outside of the key color */
kfg= x-(fabsf(z)/tanf(angle/2.0f));
@@ -115,7 +115,7 @@ static void do_chroma_key(bNode *node, float *out, float *in)
alpha=(1.0f-kfg)*(c->fstrength);
beta=atan2(z,x);
- angle2=c->t2*(float)(M_PI/180.0);
+ angle2=c->t2; /* t2 is radians. */
/* if beta is within the cutoff angle */
if(fabsf(beta) < (angle2/2.0f)) {
@@ -180,26 +180,23 @@ static void node_composit_init_chroma_matte(bNodeTree *UNUSED(ntree), bNode* nod
{
NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
node->storage= c;
- c->t1= 30.0f;
- c->t2= 10.0f;
+ c->t1= DEG2RADF(30.0f);
+ c->t2= DEG2RADF(10.0f);
c->t3= 0.0f;
c->fsize= 0.0f;
c->fstrength= 1.0f;
}
-void register_node_type_cmp_chroma_matte(ListBase *lb)
+void register_node_type_cmp_chroma_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_CHROMA_MATTE, "Chroma Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_CHROMA_MATTE, "Chroma Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_chroma_in, cmp_node_chroma_out);
node_type_size(&ntype, 200, 80, 300);
node_type_init(&ntype, node_composit_init_chroma_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_chroma_matte);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
index 66dc9ff0304..2d56c9e5973 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
@@ -123,19 +123,16 @@ static void node_composit_init_color_matte(bNodeTree *UNUSED(ntree), bNode* node
c->fstrength= 1.0f;
}
-void register_node_type_cmp_color_matte(ListBase *lb)
+void register_node_type_cmp_color_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COLOR_MATTE, "Color Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COLOR_MATTE, "Color Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_color_in, cmp_node_color_out);
node_type_size(&ntype, 200, 80, 300);
node_type_init(&ntype, node_composit_init_color_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_color_matte);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index c85a81b9bdb..af6a295cf7f 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
@@ -324,16 +324,16 @@ static void node_composit_init_color_spill(bNodeTree *UNUSED(ntree), bNode* node
ncs->unspill=0; /* do not use unspill */
}
-void register_node_type_cmp_color_spill(ListBase *lb)
+void register_node_type_cmp_color_spill(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_color_spill_in, cmp_node_color_spill_out);
node_type_size(&ntype, 140, 80, 200);
node_type_init(&ntype, node_composit_init_color_spill);
node_type_storage(&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_color_spill);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
index f7de5801a5e..26d7aa0a3a0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
@@ -182,18 +182,16 @@ static void node_composit_init_colorbalance(bNodeTree *UNUSED(ntree), bNode* nod
n->gain[0] = n->gain[1] = n->gain[2] = 1.0f;
}
-void register_node_type_cmp_colorbalance(ListBase *lb)
+void register_node_type_cmp_colorbalance(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COLORBALANCE, "Color Balance", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COLORBALANCE, "Color Balance", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_colorbalance_in, cmp_node_colorbalance_out);
node_type_size(&ntype, 400, 200, 400);
node_type_init(&ntype, node_composit_init_colorbalance);
node_type_storage(&ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_colorbalance);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c
index 7060971830e..f3e0edfc691 100644
--- a/source/blender/nodes/composite/nodes/node_composite_common.c
+++ b/source/blender/nodes/composite/nodes/node_composite_common.c
@@ -119,6 +119,9 @@ static void *group_initexec(bNode *node)
bNodeSocket *sock;
bNodeStack *ns;
+ if (!ngroup)
+ return NULL;
+
/* initialize the internal node tree execution */
exec = ntreeCompositBeginExecTree(ngroup, 0);
@@ -137,7 +140,8 @@ static void group_freeexec(bNode *UNUSED(node), void *nodedata)
{
bNodeTreeExec *gexec= (bNodeTreeExec*)nodedata;
- ntreeCompositEndExecTree(gexec, 0);
+ if (gexec)
+ ntreeCompositEndExecTree(gexec, 0);
}
/* Copy inputs to the internal stack.
@@ -191,6 +195,9 @@ static void group_execute(void *data, int thread, struct bNode *node, void *node
{
bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
+ if (!exec)
+ return;
+
/* XXX same behavior as trunk: all nodes inside group are executed.
* it's stupid, but just makes it work. compo redesign will do this better.
*/
@@ -206,11 +213,11 @@ static void group_execute(void *data, int thread, struct bNode *node, void *node
group_move_outputs(node, out, exec->stack);
}
-void register_node_type_cmp_group(ListBase *lb)
+void register_node_type_cmp_group(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
+ node_type_base(ttype, &ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -221,7 +228,7 @@ void register_node_type_cmp_group(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, group_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -290,11 +297,11 @@ static void forloop_execute(void *data, int thread, struct bNode *node, void *no
group_move_outputs(node, out, exec->stack);
}
-void register_node_type_cmp_forloop(ListBase *lb)
+void register_node_type_cmp_forloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -306,7 +313,7 @@ void register_node_type_cmp_forloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
@@ -351,11 +358,11 @@ static void whileloop_execute(void *data, int thread, struct bNode *node, void *
group_move_outputs(node, out, exec->stack);
}
-void register_node_type_cmp_whileloop(ListBase *lb)
+void register_node_type_cmp_whileloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -367,6 +374,6 @@ void register_node_type_cmp_whileloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.c b/source/blender/nodes/composite/nodes/node_composite_composite.c
index 4eb9dd74b2e..a5f90d31643 100644
--- a/source/blender/nodes/composite/nodes/node_composite_composite.c
+++ b/source/blender/nodes/composite/nodes/node_composite_composite.c
@@ -97,15 +97,16 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i
generate_preview(data, node, in[0]->data);
}
-void register_node_type_cmp_composite(ListBase *lb)
+void register_node_type_cmp_composite(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+ node_type_base(ttype, &ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_PREVIEW);
node_type_socket_templates(&ntype, cmp_node_composite_in, NULL);
node_type_size(&ntype, 80, 60, 200);
node_type_exec(&ntype, node_composit_exec_composite);
+ /* Do not allow muting for this node. */
+ node_type_mute(&ntype, NULL, NULL);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.c b/source/blender/nodes/composite/nodes/node_composite_crop.c
index 7847726c68e..3697f3e4c5c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_crop.c
+++ b/source/blender/nodes/composite/nodes/node_composite_crop.c
@@ -111,17 +111,16 @@ static void node_composit_init_crop(bNodeTree *UNUSED(ntree), bNode* node, bNode
nxy->y2= 0;
}
-void register_node_type_cmp_crop(ListBase *lb)
+void register_node_type_cmp_crop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_crop_in, cmp_node_crop_out);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, node_composit_init_crop);
node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_crop);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c
index 2e54836e042..81424586a11 100644
--- a/source/blender/nodes/composite/nodes/node_composite_curves.c
+++ b/source/blender/nodes/composite/nodes/node_composite_curves.c
@@ -62,23 +62,22 @@ static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode* node
node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
}
-void register_node_type_cmp_curve_time(ListBase *lb)
+void register_node_type_cmp_curve_time(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_time_out);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, node_composit_init_curves_time);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_composit_exec_curves_time);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
/* **************** CURVE VEC ******************** */
static bNodeSocketTemplate cmp_node_curve_vec_in[]= {
{ SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE},
@@ -103,18 +102,18 @@ static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode* node,
node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
}
-void register_node_type_cmp_curve_vec(ListBase *lb)
+void register_node_type_cmp_curve_vec(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_curve_vec_in, cmp_node_curve_vec_out);
node_type_size(&ntype, 200, 140, 320);
node_type_init(&ntype, node_composit_init_curve_vec);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_composit_exec_curve_vec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -190,18 +189,16 @@ static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode* node,
node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
}
-void register_node_type_cmp_curve_rgb(ListBase *lb)
+void register_node_type_cmp_curve_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_curve_rgb_in, cmp_node_curve_rgb_out);
node_type_size(&ntype, 200, 140, 320);
node_type_init(&ntype, node_composit_init_curve_rgb);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_composit_exec_curve_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c
index 9b32e0f6f3f..1e7c8e8b58c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_defocus.c
+++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c
@@ -58,8 +58,9 @@ typedef struct BokehCoeffs {
static void makeBokeh(char bktype, char ro, int* len_bkh, float* inradsq, BokehCoeffs BKH[8], float bkh_b[4])
{
float x0, x1, y0, y1, dx, dy, iDxy;
- float w = MAX2(1e-5f, ro)*(float)(M_PI/180); // never reported stangely enough, but a zero offset causes missing center line...
- float wi = (360.f/bktype)*(float)(M_PI/180);
+ /* ro now is in radians. */
+ float w = MAX2(1e-6f, ro); // never reported stangely enough, but a zero offset causes missing center line...
+ float wi = DEG2RADF(360.f/bktype);
int i, ov, nv;
// bktype must be at least 3 & <= 8
@@ -260,7 +261,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
if (camob && camob->type==OB_CAMERA) {
Camera* cam = (Camera*)camob->data;
cam_lens = cam->lens;
- cam_fdist = dof_camera(camob);
+ cam_fdist = object_camera_dof_distance(camob);
if (cam_fdist==0.0f) cam_fdist = 1e10f; /* if the dof is 0.0 then set it be be far away */
cam_invfdist = 1.f/cam_fdist;
}
@@ -862,7 +863,7 @@ static void node_composit_init_defocus(bNodeTree *UNUSED(ntree), bNode* node, bN
/* qdn: defocus node */
NodeDefocus *nbd = MEM_callocN(sizeof(NodeDefocus), "node defocus data");
nbd->bktype = 0;
- nbd->rotation = 0.f;
+ nbd->rotation = 0.0f;
nbd->preview = 1;
nbd->gamco = 0;
nbd->samples = 16;
@@ -874,19 +875,16 @@ static void node_composit_init_defocus(bNodeTree *UNUSED(ntree), bNode* node, bN
node->storage = nbd;
}
-void register_node_type_cmp_defocus(ListBase *lb)
+void register_node_type_cmp_defocus(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_defocus_in, cmp_node_defocus_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_defocus);
node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_defocus);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index 3b2a2342167..eae59dea3f4 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -131,19 +131,16 @@ static void node_composit_init_diff_matte(bNodeTree *UNUSED(ntree), bNode* node,
c->t2= 0.1f;
}
-void register_node_type_cmp_diff_matte(ListBase *lb)
+void register_node_type_cmp_diff_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DIFF_MATTE, "Difference Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DIFF_MATTE, "Difference Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_diff_matte_in, cmp_node_diff_matte_out);
node_type_size(&ntype, 200, 80, 250);
node_type_init(&ntype, node_composit_init_diff_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_diff_matte);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.c b/source/blender/nodes/composite/nodes/node_composite_dilate.c
index 751db641785..f8abf96e742 100644
--- a/source/blender/nodes/composite/nodes/node_composite_dilate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_dilate.c
@@ -146,16 +146,14 @@ static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNod
}
}
-void register_node_type_cmp_dilateerode(ListBase *lb)
+void register_node_type_cmp_dilateerode(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DILATEERODE, "Dilate/Erode", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DILATEERODE, "Dilate/Erode", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_dilateerode_in, cmp_node_dilateerode_out);
node_type_size(&ntype, 130, 100, 320);
node_type_exec(&ntype, node_composit_exec_dilateerode);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
index 802ef2d8e12..d0f7feccf2e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
@@ -47,7 +47,7 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap,
{
if ((dist != 0.f) || (spin != 0.f) || (zoom != 0.f)) {
void (*getpix)(CompBuf*, float, float, float*) = wrap ? qd_getPixelLerpWrap : qd_getPixelLerp;
- const float a= angle * (float)M_PI / 180.f;
+ const float a= angle;
const float itsc= 1.f / powf(2.f, (float)iterations);
float D;
float center_x_pix, center_y_pix;
@@ -65,7 +65,7 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap,
tx= itsc * D * cosf(a);
ty= -itsc * D * sinf(a);
sc= itsc * zoom;
- rot= itsc * spin * (float)M_PI / 180.f;
+ rot= itsc * spin;
/* blur the image */
for(i= 0; i < iterations; ++i) {
@@ -130,17 +130,16 @@ static void node_composit_init_dblur(bNodeTree *UNUSED(ntree), bNode* node, bNod
ndbd->center_y= 0.5;
}
-void register_node_type_cmp_dblur(ListBase *lb)
+void register_node_type_cmp_dblur(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DBLUR, "Directional Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DBLUR, "Directional Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_dblur_in, cmp_node_dblur_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_dblur);
node_type_storage(&ntype, "NodeDBlurData", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_dblur);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c
index a55a6093f12..ad7c1fa589e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_displace.c
+++ b/source/blender/nodes/composite/nodes/node_composite_displace.c
@@ -182,16 +182,14 @@ static void node_composit_exec_displace(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_displace(ListBase *lb)
+void register_node_type_cmp_displace(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DISPLACE, "Displace", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DISPLACE, "Displace", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_displace_in, cmp_node_displace_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_displace);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
index 27fe66cbe0d..292bb66613d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
@@ -128,19 +128,16 @@ static void node_composit_init_distance_matte(bNodeTree *UNUSED(ntree), bNode* n
c->t2= 0.1f;
}
-void register_node_type_cmp_distance_matte(ListBase *lb)
+void register_node_type_cmp_distance_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_DIST_MATTE, "Distance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_DIST_MATTE, "Distance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_distance_matte_in, cmp_node_distance_matte_out);
node_type_size(&ntype, 200, 80, 250);
node_type_init(&ntype, node_composit_init_distance_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_distance_matte);
- nodeRegisterType(lb, &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 1a0c51fab53..94a109de8f2 100644
--- a/source/blender/nodes/composite/nodes/node_composite_filter.c
+++ b/source/blender/nodes/composite/nodes/node_composite_filter.c
@@ -220,18 +220,15 @@ static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in,
}
-void register_node_type_cmp_filter(ListBase *lb)
+void register_node_type_cmp_filter(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_FILTER, "Filter", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_FILTER, "Filter", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_filter_in, cmp_node_filter_out);
node_type_size(&ntype, 80, 40, 120);
node_type_label(&ntype, node_filter_label);
node_type_exec(&ntype, node_composit_exec_filter);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_flip.c b/source/blender/nodes/composite/nodes/node_composite_flip.c
index 01f58182227..974a14037eb 100644
--- a/source/blender/nodes/composite/nodes/node_composite_flip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_flip.c
@@ -88,17 +88,14 @@ static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack
}
}
-void register_node_type_cmp_flip(ListBase *lb)
+void register_node_type_cmp_flip(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_FLIP, "Flip", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_FLIP, "Flip", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_flip_in, cmp_node_flip_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_flip);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c
index ad377799dea..90135b5cf35 100644
--- a/source/blender/nodes/composite/nodes/node_composite_gamma.c
+++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c
@@ -75,14 +75,14 @@ static void node_composit_exec_gamma(void *UNUSED(data), bNode *node, bNodeStack
}
}
-void register_node_type_cmp_gamma(ListBase *lb)
+void register_node_type_cmp_gamma(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_gamma_in, cmp_node_gamma_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_gamma);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c
index b7cc1d3c92d..d4e15f780e5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_glare.c
+++ b/source/blender/nodes/composite/nodes/node_composite_glare.c
@@ -238,7 +238,7 @@ static void streaks(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
int x, y, n;
unsigned int nump=0;
fRGB c1, c2, c3, c4;
- float a, ang = 360.f/(float)ndg->angle;
+ float a, ang = DEG2RADF(360.0f)/(float)ndg->angle;
bsrc = BTP(src, ndg->threshold, 1 << ndg->quality);
tsrc = dupalloc_compbuf(bsrc); // sample from buffer
@@ -246,8 +246,8 @@ static void streaks(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
sbuf = alloc_compbuf(tsrc->x, tsrc->y, tsrc->type, 1); // streak sum buffer
- for (a=0.f; a<360.f; a+=ang) {
- const float an = (a + (float)ndg->angle_ofs)*(float)M_PI/180.f;
+ for (a=0.f; a<DEG2RADF(360.0f); a+=ang) {
+ const float an = a + ndg->angle_ofs;
const float vx = cos((double)an), vy = sin((double)an);
for (n=0; n<ndg->iter; ++n) {
const float p4 = pow(4.0, (double)n);
@@ -483,23 +483,22 @@ static void node_composit_init_glare(bNodeTree *UNUSED(ntree), bNode* node, bNod
ndg->mix = 0;
ndg->threshold = 1;
ndg->angle = 4;
- ndg->angle_ofs = 0;
+ ndg->angle_ofs = 0.0f;
ndg->fade = 0.9;
ndg->size = 8;
node->storage = ndg;
}
-void register_node_type_cmp_glare(ListBase *lb)
+void register_node_type_cmp_glare(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_GLARE, "Glare", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_GLARE, "Glare", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_glare_in, cmp_node_glare_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_glare);
node_type_storage(&ntype, "NodeGlare", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_glare);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
index 711560a0a94..c4598717e00 100644
--- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
@@ -102,19 +102,16 @@ static void node_composit_init_hue_sat(bNodeTree *UNUSED(ntree), bNode* node, bN
nhs->val= 1.0f;
}
-void register_node_type_cmp_hue_sat(ListBase *lb)
+void register_node_type_cmp_hue_sat(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_hue_sat_in, cmp_node_hue_sat_out);
node_type_size(&ntype, 150, 80, 250);
node_type_init(&ntype, node_composit_init_hue_sat);
node_type_storage(&ntype, "NodeHueSat", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_hue_sat);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
index acb70f13ec2..6b0849b2391 100644
--- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
+++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
@@ -151,18 +151,16 @@ static void node_composit_init_huecorrect(bNodeTree *UNUSED(ntree), bNode* node,
cumapping->cur = 1;
}
-void register_node_type_cmp_huecorrect(ListBase *lb)
+void register_node_type_cmp_huecorrect(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_HUECORRECT, "Hue Correct", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_HUECORRECT, "Hue Correct", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_huecorrect_in, cmp_node_huecorrect_out);
node_type_size(&ntype, 320, 140, 400);
node_type_init(&ntype, node_composit_init_huecorrect);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_composit_exec_huecorrect);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c
index 914483bc52f..0600e44b0d0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_idMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c
@@ -107,17 +107,14 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in,
}
-void register_node_type_cmp_idmask(ListBase *lb)
+void register_node_type_cmp_idmask(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_ID_MASK, "ID Mask", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_ID_MASK, "ID Mask", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_idmask_in, cmp_node_idmask_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_idmask);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 672d2af0646..9920cdab039 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -314,18 +314,18 @@ static void node_composit_init_image(bNodeTree *UNUSED(ntree), bNode* node, bNod
iuser->ok= 1;
}
-void register_node_type_cmp_image(ListBase *lb)
+void register_node_type_cmp_image(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_rlayers_out);
node_type_size(&ntype, 120, 80, 300);
node_type_init(&ntype, node_composit_init_image);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_image);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -445,17 +445,14 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNU
}
-void register_node_type_cmp_rlayers(ListBase *lb)
+void register_node_type_cmp_rlayers(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_R_LAYERS, "Render Layers", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_R_LAYERS, "Render Layers", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_rlayers_out);
node_type_size(&ntype, 150, 100, 300);
node_type_exec(&ntype, node_composit_exec_rlayers);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c
index d98f5a1c64b..4fda90e0a1e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_invert.c
+++ b/source/blender/nodes/composite/nodes/node_composite_invert.c
@@ -118,16 +118,15 @@ static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode* node, bNo
}
/* custom1 = mix type */
-void register_node_type_cmp_invert(ListBase *lb)
+void register_node_type_cmp_invert(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_invert_in, cmp_node_invert_out);
node_type_size(&ntype, 120, 120, 140);
node_type_init(&ntype, node_composit_init_invert);
node_type_exec(&ntype, node_composit_exec_invert);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_lensdist.c b/source/blender/nodes/composite/nodes/node_composite_lensdist.c
index e57f405ed68..5d3a9323f52 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lensdist.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lensdist.c
@@ -190,17 +190,16 @@ static void node_composit_init_lensdist(bNodeTree *UNUSED(ntree), bNode* node, b
}
-void register_node_type_cmp_lensdist(ListBase *lb)
+void register_node_type_cmp_lensdist(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_LENSDIST, "Lens Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_LENSDIST, "Lens Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_lensdist_in, cmp_node_lensdist_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_lensdist);
node_type_storage(&ntype, "NodeLensDist", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_lensdist);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c
index f3e4f0db8b6..9417e504a1b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_levels.c
+++ b/source/blender/nodes/composite/nodes/node_composite_levels.c
@@ -320,18 +320,16 @@ static void node_composit_init_view_levels(bNodeTree *UNUSED(ntree), bNode* node
node->custom1=1; /*All channels*/
}
-void register_node_type_cmp_view_levels(ListBase *lb)
+void register_node_type_cmp_view_levels(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_VIEW_LEVELS, "Levels", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW);
+ node_type_base(ttype, &ntype, CMP_NODE_VIEW_LEVELS, "Levels", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_socket_templates(&ntype, cmp_node_view_levels_in, cmp_node_view_levels_out);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, node_composit_init_view_levels);
node_type_storage(&ntype, "ImageUser", NULL, NULL);
node_type_exec(&ntype, node_composit_exec_view_levels);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
index 8573849b069..ad5e9d423e5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
@@ -104,18 +104,16 @@ static void node_composit_init_luma_matte(bNodeTree *UNUSED(ntree), bNode* node,
c->t2= 0.0f;
}
-void register_node_type_cmp_luma_matte(ListBase *lb)
+void register_node_type_cmp_luma_matte(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_LUMA_MATTE, "Luminance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_LUMA_MATTE, "Luminance Key", NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_luma_matte_in, cmp_node_luma_matte_out);
node_type_size(&ntype, 200, 80, 250);
node_type_init(&ntype, node_composit_init_luma_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_luma_matte);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapUV.c b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
index b596f67a886..1ca729c8393 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapUV.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
@@ -162,17 +162,14 @@ static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack
}
}
-void register_node_type_cmp_mapuv(ListBase *lb)
+void register_node_type_cmp_mapuv(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MAP_UV, "Map UV", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MAP_UV, "Map UV", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_mapuv_in, cmp_node_mapuv_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_mapuv);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapValue.c b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
index 6930fbf0664..380aa0b716b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapValue.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
@@ -82,20 +82,16 @@ static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode* node,
node->storage= add_tex_mapping();
}
-void register_node_type_cmp_map_value(ListBase *lb)
+void register_node_type_cmp_map_value(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_map_value_in, cmp_node_map_value_out);
node_type_size(&ntype, 100, 60, 150);
node_type_init(&ntype, node_composit_init_map_value);
node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_map_value);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_math.c b/source/blender/nodes/composite/nodes/node_composite_math.c
index 27fdcfc1d4e..6c2cbb9a92b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_math.c
+++ b/source/blender/nodes/composite/nodes/node_composite_math.c
@@ -194,19 +194,15 @@ static void node_composit_exec_math(void *UNUSED(data), bNode *node, bNodeStack
out[0]->data= stackbuf;
}
-void register_node_type_cmp_math(ListBase *lb)
+void register_node_type_cmp_math(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_math_in, cmp_node_math_out);
node_type_size(&ntype, 120, 110, 160);
node_type_label(&ntype, node_math_label);
node_type_exec(&ntype, node_composit_exec_math);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
index 275d949da28..4a303e911e2 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
@@ -82,16 +82,15 @@ static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in,
}
/* custom1 = mix type */
-void register_node_type_cmp_mix_rgb(ListBase *lb)
+void register_node_type_cmp_mix_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_mix_rgb_in, cmp_node_mix_rgb_out);
node_type_size(&ntype, 110, 60, 120);
node_type_label(&ntype, node_blend_label);
node_type_exec(&ntype, node_composit_exec_mix_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
index 8931b899017..1f449f8c16a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_movieclip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
@@ -142,16 +142,16 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(nt
user->framenr= 1;
}
-void register_node_type_cmp_movieclip(ListBase *lb)
+void register_node_type_cmp_movieclip(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_movieclip_out);
node_type_size(&ntype, 120, 80, 300);
node_type_init(&ntype, init);
node_type_storage(&ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_movieclip);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
index 8411de39353..bc3f648a374 100644
--- a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
+++ b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
@@ -118,22 +118,22 @@ static void storage_free(bNode *node)
node->storage= NULL;
}
-void storage_copy(bNode *orig_node, bNode *new_node)
+static void storage_copy(bNode *orig_node, bNode *new_node)
{
if(orig_node->storage)
new_node->storage= BKE_tracking_distortion_copy(orig_node->storage);
}
-void register_node_type_cmp_moviedistortion(ListBase *lb)
+void register_node_type_cmp_moviedistortion(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_moviedistortion_in, cmp_node_moviedistortion_out);
node_type_size(&ntype, 140, 100, 320);
node_type_label(&ntype, label);
node_type_exec(&ntype, exec);
node_type_storage(&ntype, NULL, storage_free, storage_copy);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c
index 4c43871d867..fbbd58932ea 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normal.c
@@ -91,17 +91,15 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(nt
nor[2] = 1.0f;
}
-void register_node_type_cmp_normal(ListBase *lb)
+void register_node_type_cmp_normal(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_normal_in, cmp_node_normal_out);
node_type_init(&ntype, init);
node_type_size(&ntype, 100, 60, 200);
node_type_exec(&ntype, node_composit_exec_normal);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c
index d14f589f3f2..455966e4f38 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normalize.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c
@@ -101,14 +101,14 @@ static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeS
}
}
-void register_node_type_cmp_normalize(ListBase *lb)
+void register_node_type_cmp_normalize(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_normalize_in, cmp_node_normalize_out);
node_type_size(&ntype, 100, 60, 150);
node_type_exec(&ntype, node_composit_exec_normalize);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_outputFile.c b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
index 5b502bbee7b..b2177002e82 100644
--- a/source/blender/nodes/composite/nodes/node_composite_outputFile.c
+++ b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
@@ -56,6 +56,7 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack *
* 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[256];
@@ -74,7 +75,7 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack *
}
}
- BKE_makepicstring(string, nif->name, rd->cfra, nif->imtype, (rd->scemode & R_EXTENSION), TRUE);
+ BKE_makepicstring(string, nif->name, bmain->name, rd->cfra, nif->imtype, (rd->scemode & R_EXTENSION), TRUE);
if(0 == BKE_write_ibuf(ibuf, string, nif->imtype, nif->subimtype, nif->imtype==R_OPENEXR?nif->codec:nif->quality))
printf("Cannot save Node File Output to %s\n", string);
@@ -107,19 +108,16 @@ static void node_composit_init_output_file(bNodeTree *UNUSED(ntree), bNode* node
}
}
-void register_node_type_cmp_output_file(ListBase *lb)
+void register_node_type_cmp_output_file(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
+ 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(lb, &ntype);
+ 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 b188b0dd323..bf934fcd0f7 100644
--- a/source/blender/nodes/composite/nodes/node_composite_premulkey.c
+++ b/source/blender/nodes/composite/nodes/node_composite_premulkey.c
@@ -61,16 +61,14 @@ static void node_composit_exec_premulkey(void *UNUSED(data), bNode *node, bNodeS
}
}
-void register_node_type_cmp_premulkey(ListBase *lb)
+void register_node_type_cmp_premulkey(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_PREMULKEY, "Alpha Convert", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_PREMULKEY, "Alpha Convert", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_premulkey_in, cmp_node_premulkey_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_premulkey);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_rgb.c b/source/blender/nodes/composite/nodes/node_composite_rgb.c
index 12f073a816d..ca9db716b66 100644
--- a/source/blender/nodes/composite/nodes/node_composite_rgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_rgb.c
@@ -58,18 +58,15 @@ static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack *
copy_v4_v4(out[0]->vec, col);
}
-void register_node_type_cmp_rgb(ListBase *lb)
+void register_node_type_cmp_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_rgb_out);
node_type_init(&ntype, node_composit_init_rgb);
node_type_size(&ntype, 140, 80, 140);
node_type_exec(&ntype, node_composit_exec_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c
index 730c53a1a29..826653c6cff 100644
--- a/source/blender/nodes/composite/nodes/node_composite_rotate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c
@@ -58,7 +58,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
int x, y, yo, xo;
ImBuf *ibuf, *obuf;
- rad= ((float)M_PI*in[1]->vec[0])/180.0f;
+ rad= in[1]->vec[0];
s= sin(rad);
@@ -126,16 +126,15 @@ static void node_composit_init_rotate(bNodeTree *UNUSED(ntree), bNode* node, bNo
node->custom1= 1; /* Bilinear Filter*/
}
-void register_node_type_cmp_rotate(ListBase *lb)
+void register_node_type_cmp_rotate(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_rotate_in, cmp_node_rotate_out);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, node_composit_init_rotate);
node_type_exec(&ntype, node_composit_exec_rotate);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.c b/source/blender/nodes/composite/nodes/node_composite_scale.c
index 37332c9bd7e..188449df5fb 100644
--- a/source/blender/nodes/composite/nodes/node_composite_scale.c
+++ b/source/blender/nodes/composite/nodes/node_composite_scale.c
@@ -129,21 +129,14 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
}
}
-void register_node_type_cmp_scale(ListBase *lb)
+void register_node_type_cmp_scale(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_scale_in, cmp_node_scale_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_scale);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
-
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
index bf58d443aec..d742a916fdf 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
@@ -99,16 +99,16 @@ static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeSta
}
}
-void register_node_type_cmp_sephsva(ListBase *lb)
+void register_node_type_cmp_sephsva(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SEPHSVA, "Separate HSVA", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, CMP_NODE_SEPHSVA, "Separate HSVA", NODE_CLASS_CONVERTOR, 0);
node_type_socket_templates(&ntype, cmp_node_sephsva_in, cmp_node_sephsva_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_sephsva);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -169,17 +169,14 @@ static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_combhsva(ListBase *lb)
+void register_node_type_cmp_combhsva(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COMBHSVA, "Combine HSVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COMBHSVA, "Combine HSVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_combhsva_in, cmp_node_combhsva_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_combhsva);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
index ade2b22bf35..1f0b504f161 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
@@ -77,16 +77,16 @@ static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node),
}
}
-void register_node_type_cmp_seprgba(ListBase *lb)
+void register_node_type_cmp_seprgba(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SEPRGBA, "Separate RGBA", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, CMP_NODE_SEPRGBA, "Separate RGBA", NODE_CLASS_CONVERTOR, 0);
node_type_socket_templates(&ntype, cmp_node_seprgba_in, cmp_node_seprgba_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_seprgba);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -145,16 +145,14 @@ static void node_composit_exec_combrgba(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_combrgba(ListBase *lb)
+void register_node_type_cmp_combrgba(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COMBRGBA, "Combine RGBA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COMBRGBA, "Combine RGBA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_combrgba_in, cmp_node_combrgba_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_combrgba);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
index 7944176c5d3..a5f827b094d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
@@ -148,16 +148,16 @@ static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeSta
}
}
-void register_node_type_cmp_sepycca(ListBase *lb)
+void register_node_type_cmp_sepycca(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_sepycca_in, cmp_node_sepycca_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_sepycca);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -295,17 +295,14 @@ static void node_composit_exec_combycca(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_combycca(ListBase *lb)
+void register_node_type_cmp_combycca(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_combycca_in, cmp_node_combycca_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_combycca);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
index aedb5652e61..2a2f64a5209 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
@@ -99,16 +99,16 @@ static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeSta
}
}
-void register_node_type_cmp_sepyuva(ListBase *lb)
+void register_node_type_cmp_sepyuva(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SEPYUVA, "Separate YUVA", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, CMP_NODE_SEPYUVA, "Separate YUVA", NODE_CLASS_CONVERTOR, 0);
node_type_socket_templates(&ntype, cmp_node_sepyuva_in, cmp_node_sepyuva_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_sepyuva);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -170,16 +170,14 @@ static void node_composit_exec_combyuva(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_combyuva(ListBase *lb)
+void register_node_type_cmp_combyuva(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_COMBYUVA, "Combine YUVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_COMBYUVA, "Combine YUVA", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_combyuva_in, cmp_node_combyuva_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_composit_exec_combyuva);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.c b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
index 2b19ebfe5a3..6c24185bb88 100644
--- a/source/blender/nodes/composite/nodes/node_composite_setalpha.c
+++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
@@ -73,15 +73,14 @@ static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeSt
}
}
-void register_node_type_cmp_setalpha(ListBase *lb)
+void register_node_type_cmp_setalpha(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_setalpha_in, cmp_node_setalpha_out);
node_type_size(&ntype, 120, 40, 140);
node_type_exec(&ntype, node_composit_exec_setalpha);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
index b63b42224e2..bc8bc7c84d1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
@@ -149,21 +149,18 @@ static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode* node
node->custom1= 50; /* default 50% split */
}
-void register_node_type_cmp_splitviewer(ListBase *lb)
+void register_node_type_cmp_splitviewer(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_SPLITVIEWER, "SplitViewer", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_SPLITVIEWER, "SplitViewer", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_splitviewer_in, NULL);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, node_composit_init_splitviewer);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_splitviewer);
+ /* Do not allow muting this node. */
+ node_type_mute(&ntype, NULL, NULL);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
index c5d60e65530..f41751b3e15 100644
--- a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
+++ b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
@@ -66,14 +66,14 @@ static void node_composit_exec_stabilize2d(void *data, bNode *node, bNodeStack *
}
}
-void register_node_type_cmp_stabilize2d(ListBase *lb)
+void register_node_type_cmp_stabilize2d(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_stabilize2d_in, cmp_node_stabilize2d_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_stabilize2d);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c
index 2f54f27e481..7f8f14bcfc5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_texture.c
+++ b/source/blender/nodes/composite/nodes/node_composite_texture.c
@@ -142,17 +142,14 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
}
}
-void register_node_type_cmp_texture(ListBase *lb)
+void register_node_type_cmp_texture(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
+ node_type_base(ttype, &ntype, CMP_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_socket_templates(&ntype, cmp_node_texture_in, cmp_node_texture_out);
node_type_size(&ntype, 120, 80, 240);
node_type_exec(&ntype, node_composit_exec_texture);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
index 36e583a77ff..9b34e117496 100644
--- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c
+++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
@@ -162,17 +162,16 @@ static void node_composit_init_tonemap(bNodeTree *UNUSED(ntree), bNode* node, bN
node->storage = ntm;
}
-void register_node_type_cmp_tonemap(ListBase *lb)
+void register_node_type_cmp_tonemap(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_tonemap_in, cmp_node_tonemap_out);
node_type_size(&ntype, 150, 120, 200);
node_type_init(&ntype, node_composit_init_tonemap);
node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_tonemap);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_transform.c b/source/blender/nodes/composite/nodes/node_composite_transform.c
index de9b8fceaee..7e096bf0545 100644
--- a/source/blender/nodes/composite/nodes/node_composite_transform.c
+++ b/source/blender/nodes/composite/nodes/node_composite_transform.c
@@ -127,16 +127,14 @@ static void node_composit_exec_transform(void *UNUSED(data), bNode *node, bNodeS
}
}
-void register_node_type_cmp_transform(ListBase *lb)
+void register_node_type_cmp_transform(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_TRANSFORM, "Transform", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_TRANSFORM, "Transform", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_transform_in, cmp_node_transform_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_transform);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.c b/source/blender/nodes/composite/nodes/node_composite_translate.c
index 2b25ef92a1e..073b035add0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_translate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_translate.c
@@ -59,16 +59,14 @@ static void node_composit_exec_translate(void *UNUSED(data), bNode *UNUSED(node)
}
}
-void register_node_type_cmp_translate(ListBase *lb)
+void register_node_type_cmp_translate(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_translate_in, cmp_node_translate_out);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, node_composit_exec_translate);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
index 014f40a1a48..30f624641d1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
@@ -83,18 +83,18 @@ static void node_composit_init_valtorgb(bNodeTree *UNUSED(ntree), bNode* node, b
node->storage= add_colorband(1);
}
-void register_node_type_cmp_valtorgb(ListBase *lb)
+void register_node_type_cmp_valtorgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_valtorgb_in, cmp_node_valtorgb_out);
node_type_size(&ntype, 240, 200, 300);
node_type_init(&ntype, node_composit_init_valtorgb);
node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_valtorgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -137,14 +137,14 @@ static void node_composit_exec_rgbtobw(void *UNUSED(data), bNode *node, bNodeSta
}
}
-void register_node_type_cmp_rgbtobw(ListBase *lb)
+void register_node_type_cmp_rgbtobw(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
node_type_socket_templates(&ntype, cmp_node_rgbtobw_in, cmp_node_rgbtobw_out);
node_type_size(&ntype, 80, 40, 120);
node_type_exec(&ntype, node_composit_exec_rgbtobw);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_value.c b/source/blender/nodes/composite/nodes/node_composite_value.c
index a38187847fd..3cecb69bc7e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_value.c
+++ b/source/blender/nodes/composite/nodes/node_composite_value.c
@@ -57,17 +57,15 @@ static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack
out[0]->vec[0]= val;
}
-void register_node_type_cmp_value(ListBase *lb)
+void register_node_type_cmp_value(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, cmp_node_value_out);
node_type_init(&ntype, node_composit_init_value);
node_type_size(&ntype, 80, 40, 120);
node_type_exec(&ntype, node_composit_exec_value);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
index a0fbcec198a..69f896e9bb5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
@@ -94,18 +94,16 @@ static void node_composit_init_vecblur(bNodeTree *UNUSED(ntree), bNode* node, bN
}
/* custom1: itterations, custom2: maxspeed (0 = nolimit) */
-void register_node_type_cmp_vecblur(ListBase *lb)
+void register_node_type_cmp_vecblur(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_VECBLUR, "Vector Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_VECBLUR, "Vector Blur", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_vecblur_in, cmp_node_vecblur_out);
node_type_size(&ntype, 120, 80, 200);
node_type_init(&ntype, node_composit_init_vecblur);
node_type_storage(&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_vecblur);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.c b/source/blender/nodes/composite/nodes/node_composite_viewer.c
index fcf7fe530bd..6a0c074cdb3 100644
--- a/source/blender/nodes/composite/nodes/node_composite_viewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_viewer.c
@@ -131,16 +131,18 @@ static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode* node, bNo
iuser->ok= 1;
}
-void register_node_type_cmp_viewer(ListBase *lb)
+void register_node_type_cmp_viewer(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+ node_type_base(ttype, &ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
node_type_socket_templates(&ntype, cmp_node_viewer_in, NULL);
node_type_size(&ntype, 80, 60, 200);
node_type_init(&ntype, node_composit_init_viewer);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, node_composit_exec_viewer);
+ /* Do not allow muting this node. */
+ node_type_mute(&ntype, NULL, NULL);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_zcombine.c b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
index 868c0d2b5f3..57b0b7bbf14 100644
--- a/source/blender/nodes/composite/nodes/node_composite_zcombine.c
+++ b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
@@ -222,15 +222,14 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
}
-void register_node_type_cmp_zcombine(ListBase *lb)
+void register_node_type_cmp_zcombine(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, CMP_NODE_ZCOMBINE, "Z Combine", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_ZCOMBINE, "Z Combine", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_zcombine_in, cmp_node_zcombine_out);
node_type_size(&ntype, 80, 40, 120);
node_type_exec(&ntype, node_composit_exec_zcombine);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 11dcf44a288..5ad84da45d2 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -973,15 +973,15 @@ bNodeTemplate node_whileloop_template(bNode *node)
/**** FRAME ****/
-void register_node_type_frame(ListBase *lb)
+void register_node_type_frame(bNodeTreeType *ttype)
{
/* frame type is used for all tree types, needs dynamic allocation */
bNodeType *ntype= MEM_callocN(sizeof(bNodeType), "frame node type");
- node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND);
+ node_type_base(ttype, ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND);
node_type_size(ntype, 150, 100, 0);
node_type_compatibility(ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
ntype->needs_free = 1;
- nodeRegisterType(lb, ntype);
+ nodeRegisterType(ttype, ntype);
}
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index b6374aeb386..1def0c31983 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -276,7 +276,13 @@ void ntreeExecNodes(bNodeTreeExec *exec, void *callerdata, int thread)
node = nodeexec->node;
if(node->need_exec) {
node_get_stack(node, exec->stack, nsin, nsout);
- if(node->typeinfo->execfunc)
+ /* Handle muted nodes...
+ * If the mute func is not set, assume the node should never be muted,
+ * and hence execute it!
+ */
+ if((node->flag & NODE_MUTED) && node->typeinfo->mutefunc)
+ node->typeinfo->mutefunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
+ else 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,7 +304,13 @@ void ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *call
node = nodeexec->node;
if(node->need_exec) {
node_get_stack(node, nts->stack, nsin, nsout);
- if(node->typeinfo->execfunc)
+ /* Handle muted nodes...
+ * If the mute func is not set, assume the node should never be muted,
+ * and hence execute it!
+ */
+ if((node->flag & NODE_MUTED) && node->typeinfo->mutefunc)
+ node->typeinfo->mutefunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
+ else 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_util.c b/source/blender/nodes/intern/node_util.c
index da85dd0a5ea..dabad10f568 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -97,3 +97,64 @@ const char *node_filter_label(bNode *node)
RNA_enum_name(node_filter_items, node->custom1, &name);
return name;
}
+
+/* Returns a list of mapping of some input bNodeStack, GPUNodeStack or bNodeSocket
+ * to one or more outputs of the same type.
+ * *ntree or (**nsin, **nsout) or (*gnsin, *gnsout) must not be NULL. */
+ListBase node_mute_get_links(bNodeTree *ntree, bNode *node, bNodeStack **nsin, bNodeStack **nsout,
+ GPUNodeStack *gnsin, GPUNodeStack *gnsout)
+{
+ static int types[] = { SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA };
+ bNodeLink link = {NULL};
+ ListBase ret;
+ LinkInOutsMuteNode *lnk;
+ int in, out, i;
+
+ ret.first = ret.last = NULL;
+
+ /* Security check! */
+ if(!(ntree || (nsin && nsout) || (gnsin && gnsout)))
+ return ret;
+
+ /* Connect the first input of each type with first output of the same type. */
+
+ link.fromnode = link.tonode = node;
+ for (i=0; i < 3; ++i) {
+ /* find input socket */
+ for (in=0, link.fromsock=node->inputs.first; link.fromsock; in++, link.fromsock=link.fromsock->next) {
+ if (link.fromsock->type==types[i] && (ntree ? nodeCountSocketLinks(ntree, link.fromsock) : nsin ? nsin[in]->hasinput : gnsin[in].hasinput))
+ break;
+ }
+ if (link.fromsock) {
+ for (out=0, link.tosock=node->outputs.first; link.tosock; out++, link.tosock=link.tosock->next) {
+ if (link.tosock->type==types[i] && (ntree ? nodeCountSocketLinks(ntree, link.tosock) : nsout ? nsout[out]->hasoutput : gnsout[out].hasoutput))
+ break;
+ }
+ if (link.tosock) {
+ if(nsin && nsout) {
+ lnk = MEM_mallocN(sizeof(LinkInOutsMuteNode), "Muting node: new in to outs link.");
+ lnk->in = nsin[in];
+ lnk->outs = nsout[out];
+ lnk->num_outs = 1;
+ BLI_addtail(&ret, lnk);
+ }
+ else if(gnsin && gnsout) {
+ lnk = MEM_mallocN(sizeof(LinkInOutsMuteNode), "Muting node: new in to outs link.");
+ lnk->in = &gnsin[in];
+ lnk->outs = &gnsout[out];
+ lnk->num_outs = 1;
+ BLI_addtail(&ret, lnk);
+ }
+ else {
+ lnk = MEM_mallocN(sizeof(LinkInOutsMuteNode), "Muting node: new in to outs link.");
+ lnk->in = link.fromsock;
+ lnk->outs = link.tosock;
+ lnk->num_outs = 1;
+ BLI_addtail(&ret, lnk);
+ }
+ }
+ }
+ }
+
+ return ret;
+}
diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h
index d127a49cb4b..7ca090394c3 100644
--- a/source/blender/nodes/intern/node_util.h
+++ b/source/blender/nodes/intern/node_util.h
@@ -41,6 +41,8 @@
#include "NOD_socket.h"
+#include "GPU_material.h" /* For Shader muting GPU code... */
+
struct bNodeTree;
struct bNode;
@@ -59,6 +61,15 @@ const char *node_math_label(struct bNode *node);
const char *node_vect_math_label(struct bNode *node);
const char *node_filter_label(struct bNode *node);
+typedef struct LinkInOutsMuteNode
+{
+ struct LinkInOutsMuteNode *next, *prev;
+ void *in, *outs;
+ unsigned int num_outs; /* If > 1, outs is an array of pointers that need to be freed too! */
+} LinkInOutsMuteNode;
+ListBase node_mute_get_links(struct bNodeTree *ntree, struct bNode *node, struct bNodeStack **nsin,
+ struct bNodeStack **nsout, struct GPUNodeStack *gnsin, struct GPUNodeStack *gnsout);
+
#endif
// this is needed for inlining behaviour
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 6c7667c6729..b3144ff6830 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -134,7 +134,11 @@ bNodeTreeType ntreeType_Shader = {
/* local_sync */ local_sync,
/* local_merge */ NULL,
/* update */ update,
- /* update_node */ NULL
+ /* update_node */ NULL,
+ /* validate_link */ NULL,
+ /* mute node */ node_shader_pass_on,
+ /* mute links node */ node_mute_get_links,
+ /* gpu mute node */ gpu_shader_pass_on
};
/* GPU material from shader nodes */
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index d601c205682..87585c35e6a 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -78,6 +78,54 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
/* ******************* execute and parse ************ */
+/* Used for muted nodes, just copy the vec data from input to output… */
+void node_shader_pass_on(void *UNUSED(data), int UNUSED(thread), struct bNode *node, void *UNUSED(nodedata),
+ struct bNodeStack **in, struct bNodeStack **out)
+{
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
+ int i;
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return;
+
+ /* Get default muting links (as bNodeStack pointers). */
+ links = node->typeinfo->mutelinksfunc(NULL, node, in, out, NULL, NULL);
+
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ for(i = 0; i < lnk->num_outs; i++) {
+ copy_v4_v4((((bNodeStack*)(lnk->outs))+i)->vec, ((bNodeStack*)(lnk->in))->vec);
+ }
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(i > 1)
+ MEM_freeN(lnk->outs);
+ }
+ BLI_freelistN(&links);
+}
+
+int gpu_shader_pass_on(struct GPUMaterial *mat, struct bNode *node, void *UNUSED(nodedata),
+ struct GPUNodeStack *in, struct GPUNodeStack *out)
+{
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return 0;
+
+ /* Get default muting links (as GPUNodeStack pointers). */
+ links = node->typeinfo->mutelinksfunc(NULL, node, NULL, NULL, in, out);
+
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ GPU_stack_link_mute(mat, "copy_raw", lnk);
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(lnk->num_outs > 1)
+ MEM_freeN(lnk->outs);
+ }
+
+ BLI_freelistN(&links);
+ return 1;
+}
+
/* go over all used Geometry and Texture nodes, and return a texco flag */
/* no group inside needed, this function is called for groups too */
void ntreeShaderGetTexcoMode(bNodeTree *ntree, int r_mode, short *texco, int *mode)
@@ -214,7 +262,11 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
gs->name = "";
gs->hasinput= ns->hasinput && ns->data;
- gs->hasoutput= ns->hasoutput && ns->data;
+ /* 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.
+ */
+ gs->hasoutput= ns->hasoutput /*&& ns->data*/;
gs->sockettype= ns->sockettype;
}
@@ -293,7 +345,14 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
doit = 1;
if (doit) {
- if(node->typeinfo->gpufunc) {
+ if((node->flag & NODE_MUTED) && node->typeinfo->gpumutefunc) {
+ 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->gpumutefunc(mat, node, nodeexec->data, gpuin, gpuout))
+ data_from_gpu_stack_list(&node->outputs, nsout, gpuout);
+ }
+ else 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);
diff --git a/source/blender/nodes/shader/node_shader_util.h b/source/blender/nodes/shader/node_shader_util.h
index 48e54d9d0b4..d345f3fb310 100644
--- a/source/blender/nodes/shader/node_shader_util.h
+++ b/source/blender/nodes/shader/node_shader_util.h
@@ -128,4 +128,7 @@ void node_shader_gpu_tex_mapping(struct GPUMaterial *mat, struct bNode *node, st
void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, int do_outputs);
+void node_shader_pass_on(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out);
+int gpu_shader_pass_on(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out);
+
#endif
diff --git a/source/blender/nodes/shader/nodes/node_shader_add_shader.c b/source/blender/nodes/shader/nodes/node_shader_add_shader.c
index d715971e618..c12ff54d24c 100644
--- a/source/blender/nodes/shader/nodes/node_shader_add_shader.c
+++ b/source/blender/nodes/shader/nodes/node_shader_add_shader.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -48,11 +46,11 @@ static int node_shader_gpu_add_shader(GPUMaterial *mat, bNode *UNUSED(node), GPU
}
/* node type definition */
-void register_node_type_sh_add_shader(ListBase *lb)
+void register_node_type_sh_add_shader(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_add_shader_in, sh_node_add_shader_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_add_shader(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_add_shader);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c
index 4b238f72117..bd0779ae5b1 100644
--- a/source/blender/nodes/shader/nodes/node_shader_attribute.c
+++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -45,11 +43,11 @@ static void node_shader_init_attribute(bNodeTree *UNUSED(ntree), bNode* node, bN
}
/* node type definition */
-void register_node_type_sh_attribute(ListBase *lb)
+void register_node_type_sh_attribute(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_attribute_out);
node_type_size(&ntype, 150, 60, 200);
@@ -58,6 +56,5 @@ void register_node_type_sh_attribute(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, NULL);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_background.c b/source/blender/nodes/shader/nodes/node_shader_background.c
index b2bd837d66b..6acdc5baa59 100644
--- a/source/blender/nodes/shader/nodes/node_shader_background.c
+++ b/source/blender/nodes/shader/nodes/node_shader_background.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -43,11 +41,11 @@ static bNodeSocketTemplate sh_node_background_out[]= {
};
/* node type definition */
-void register_node_type_sh_background(ListBase *lb)
+void register_node_type_sh_background(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_background_in, sh_node_background_out);
node_type_size(&ntype, 150, 60, 200);
@@ -56,6 +54,5 @@ void register_node_type_sh_background(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, NULL);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
index c71696b351c..2fd41fed92f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -49,11 +47,11 @@ static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node
}
/* node type definition */
-void register_node_type_sh_bsdf_anisotropic(ListBase *lb)
+void register_node_type_sh_bsdf_anisotropic(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Glossy Anisotropic BSDF", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_ANISOTROPIC, "Glossy Anisotropic BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out);
node_type_size(&ntype, 150, 60, 200);
@@ -62,6 +60,5 @@ void register_node_type_sh_bsdf_anisotropic(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c
index 737f77d923e..114581f8a20 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -33,6 +31,7 @@
static bNodeSocketTemplate sh_node_bsdf_diffuse_in[]= {
{ SOCK_RGBA, 1, "Color", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
+ { SOCK_FLOAT, 1, "Roughness", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ -1, 0, "" }
};
@@ -47,11 +46,11 @@ static int node_shader_gpu_bsdf_diffuse(GPUMaterial *mat, bNode *UNUSED(node), G
}
/* node type definition */
-void register_node_type_sh_bsdf_diffuse(ListBase *lb)
+void register_node_type_sh_bsdf_diffuse(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_diffuse_in, sh_node_bsdf_diffuse_out);
node_type_size(&ntype, 150, 60, 200);
@@ -60,6 +59,5 @@ void register_node_type_sh_bsdf_diffuse(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_diffuse);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
index 7d3b91d34d4..89d469a6a4d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -49,11 +47,11 @@ static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *UNUSED(node), GPU
}
/* node type definition */
-void register_node_type_sh_bsdf_glass(ListBase *lb)
+void register_node_type_sh_bsdf_glass(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_glass_in, sh_node_bsdf_glass_out);
node_type_size(&ntype, 150, 60, 200);
@@ -62,6 +60,5 @@ void register_node_type_sh_bsdf_glass(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_glass);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c
index 5ccc1cf4a61..000a211805b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -49,11 +47,11 @@ static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *UNUSED(node), GP
}
/* node type definition */
-void register_node_type_sh_bsdf_glossy(ListBase *lb)
+void register_node_type_sh_bsdf_glossy(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_glossy_in, sh_node_bsdf_glossy_out);
node_type_size(&ntype, 150, 60, 200);
@@ -62,6 +60,5 @@ void register_node_type_sh_bsdf_glossy(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_glossy);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c
index 2836714f477..60fe847ac11 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -47,11 +45,11 @@ static int node_shader_gpu_bsdf_translucent(GPUMaterial *mat, bNode *UNUSED(node
}
/* node type definition */
-void register_node_type_sh_bsdf_translucent(ListBase *lb)
+void register_node_type_sh_bsdf_translucent(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_translucent_in, sh_node_bsdf_translucent_out);
node_type_size(&ntype, 150, 60, 200);
@@ -60,6 +58,5 @@ void register_node_type_sh_bsdf_translucent(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_translucent);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c
index 5352bd9be30..301e6dfabab 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -47,11 +45,11 @@ static int node_shader_gpu_bsdf_transparent(GPUMaterial *mat, bNode *UNUSED(node
}
/* node type definition */
-void register_node_type_sh_bsdf_transparent(ListBase *lb)
+void register_node_type_sh_bsdf_transparent(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_transparent_in, sh_node_bsdf_transparent_out);
node_type_size(&ntype, 150, 60, 200);
@@ -60,6 +58,5 @@ void register_node_type_sh_bsdf_transparent(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_transparent);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c
index dfcf3b68d67..fefcf4caeaf 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -48,11 +46,11 @@ static int node_shader_gpu_bsdf_velvet(GPUMaterial *mat, bNode *UNUSED(node), GP
}
/* node type definition */
-void register_node_type_sh_bsdf_velvet(ListBase *lb)
+void register_node_type_sh_bsdf_velvet(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_bsdf_velvet(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_bsdf_velvet);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c
index 02efbd63aba..d95cc1460df 100644
--- a/source/blender/nodes/shader/nodes/node_shader_camera.c
+++ b/source/blender/nodes/shader/nodes/node_shader_camera.c
@@ -57,11 +57,11 @@ static int gpu_shader_camera(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack
return GPU_stack_link(mat, "camera", in, out, GPU_builtin(GPU_VIEW_POSITION));
}
-void register_node_type_sh_camera(ListBase *lb)
+void register_node_type_sh_camera(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_camera_out);
node_type_size(&ntype, 95, 95, 120);
@@ -69,7 +69,5 @@ void register_node_type_sh_camera(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_camera);
node_type_gpu(&ntype, gpu_shader_camera);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c
index ff995e02ca6..f75cecfe83b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_common.c
+++ b/source/blender/nodes/shader/nodes/node_shader_common.c
@@ -180,11 +180,11 @@ static int gpu_group_execute(GPUMaterial *mat, bNode *node, void *nodedata, GPUN
return 1;
}
-void register_node_type_sh_group(ListBase *lb)
+void register_node_type_sh_group(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
+ node_type_base(ttype, &ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -196,7 +196,7 @@ void register_node_type_sh_group(ListBase *lb)
node_type_exec_new(&ntype, group_initexec, group_freeexec, group_execute);
node_type_gpu_ext(&ntype, gpu_group_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -242,11 +242,11 @@ static void forloop_execute(void *data, int thread, struct bNode *node, void *no
ntreeReleaseThreadStack(nts);
}
-void register_node_type_sh_forloop(ListBase *lb)
+void register_node_type_sh_forloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -258,7 +258,7 @@ void register_node_type_sh_forloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
@@ -304,11 +304,11 @@ static void whileloop_execute(void *data, int thread, struct bNode *node, void *
ntreeReleaseThreadStack(nts);
}
-void register_node_type_sh_whileloop(ListBase *lb)
+void register_node_type_sh_whileloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -320,6 +320,6 @@ void register_node_type_sh_whileloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c
index 7ac05bb28bf..d30434f4e32 100644
--- a/source/blender/nodes/shader/nodes/node_shader_curves.c
+++ b/source/blender/nodes/shader/nodes/node_shader_curves.c
@@ -69,11 +69,11 @@ static int gpu_shader_curve_vec(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return GPU_stack_link(mat, "curves_vec", in, out, GPU_texture(size, array));
}
-void register_node_type_sh_curve_vec(ListBase *lb)
+void register_node_type_sh_curve_vec(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_curve_vec_in, sh_node_curve_vec_out);
node_type_size(&ntype, 200, 140, 320);
@@ -82,7 +82,7 @@ void register_node_type_sh_curve_vec(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_curve_vec);
node_type_gpu(&ntype, gpu_shader_curve_vec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -124,11 +124,11 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return GPU_stack_link(mat, "curves_rgb", in, out, GPU_texture(size, array));
}
-void register_node_type_sh_curve_rgb(ListBase *lb)
+void register_node_type_sh_curve_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_curve_rgb_in, sh_node_curve_rgb_out);
node_type_size(&ntype, 200, 140, 320);
@@ -137,6 +137,5 @@ void register_node_type_sh_curve_rgb(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_curve_rgb);
node_type_gpu(&ntype, gpu_shader_curve_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_dynamic.c b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
index 51ddb865c54..5e7c99f7276 100644
--- a/source/blender/nodes/shader/nodes/node_shader_dynamic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
@@ -761,32 +761,30 @@ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNode
#endif
}
-void register_node_type_sh_dynamic(ListBase *lb)
+void register_node_type_sh_dynamic(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, NULL, NULL);
+ node_type_base(ttype, &ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, NULL, NULL);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_size(&ntype, 150, 60, 300);
node_type_init(&ntype, node_dynamic_init_cb);
node_type_storage(&ntype, "NodeScriptDict", node_dynamic_free_storage_cb, node_dynamic_copy_cb);
node_type_exec(&ntype, node_dynamic_exec_cb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#else
-void register_node_type_sh_dynamic(ListBase *lb)
+void register_node_type_sh_dynamic(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, 0);
+ node_type_base(ttype, &ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, 0);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_emission.c b/source/blender/nodes/shader/nodes/node_shader_emission.c
index 6ef82890559..9eb8fc98c69 100644
--- a/source/blender/nodes/shader/nodes/node_shader_emission.c
+++ b/source/blender/nodes/shader/nodes/node_shader_emission.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -48,11 +46,11 @@ static int node_shader_gpu_emission(GPUMaterial *mat, bNode *UNUSED(node), GPUNo
}
/* node type definition */
-void register_node_type_sh_emission(ListBase *lb)
+void register_node_type_sh_emission(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_emission_in, sh_node_emission_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_emission(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_emission);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c
index c5d55c9a1c8..8e5350c2167 100644
--- a/source/blender/nodes/shader/nodes/node_shader_fresnel.c
+++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_fresnel.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -47,11 +45,11 @@ static int node_shader_gpu_fresnel(GPUMaterial *mat, bNode *UNUSED(node), GPUNod
}
/* node type definition */
-void register_node_type_sh_fresnel(ListBase *lb)
+void register_node_type_sh_fresnel(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_fresnel_in, sh_node_fresnel_out);
node_type_size(&ntype, 150, 60, 200);
@@ -60,6 +58,5 @@ void register_node_type_sh_fresnel(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_fresnel);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
index 6547194b33a..2b28eae4085 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
@@ -138,11 +138,11 @@ static int gpu_shader_geom(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUN
}
/* node type definition */
-void register_node_type_sh_geom(ListBase *lb)
+void register_node_type_sh_geom(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_GEOMETRY, "Geometry", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_GEOMETRY, "Geometry", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_geom_out);
node_type_size(&ntype, 120, 80, 160);
@@ -151,6 +151,5 @@ void register_node_type_sh_geom(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_geom);
node_type_gpu(&ntype, gpu_shader_geom);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c
index 63f6ba3928f..6b576b0c0d1 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geometry.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -50,11 +48,11 @@ static int node_shader_gpu_geometry(GPUMaterial *mat, bNode *UNUSED(node), GPUNo
}
/* node type definition */
-void register_node_type_sh_geometry(ListBase *lb)
+void register_node_type_sh_geometry(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_NEW_GEOMETRY, "Geometry", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_NEW_GEOMETRY, "Geometry", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_geometry_out);
node_type_size(&ntype, 120, 60, 200);
@@ -63,6 +61,5 @@ void register_node_type_sh_geometry(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_geometry);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.c b/source/blender/nodes/shader/nodes/node_shader_holdout.c
index 747519c861e..81dceafe21f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_holdout.c
+++ b/source/blender/nodes/shader/nodes/node_shader_holdout.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -42,11 +40,11 @@ static bNodeSocketTemplate sh_node_holdout_out[]= {
/* node type definition */
-void register_node_type_sh_holdout(ListBase *lb)
+void register_node_type_sh_holdout(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_holdout_in, sh_node_holdout_out);
node_type_size(&ntype, 150, 60, 200);
@@ -55,6 +53,5 @@ void register_node_type_sh_holdout(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, NULL);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
index 1207196381d..bfdcb5d0917 100644
--- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
@@ -80,19 +80,16 @@ static int gpu_shader_hue_sat(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac
return GPU_stack_link(mat, "hue_sat", in, out);
}
-void register_node_type_sh_hue_sat(ListBase *lb)
+void register_node_type_sh_hue_sat(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_hue_sat_in, sh_node_hue_sat_out);
node_type_size(&ntype, 150, 80, 250);
node_type_exec(&ntype, node_shader_exec_hue_sat);
node_type_gpu(&ntype, gpu_shader_hue_sat);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c
index e3dacefbcf2..6d21b93fb65 100644
--- a/source/blender/nodes/shader/nodes/node_shader_invert.c
+++ b/source/blender/nodes/shader/nodes/node_shader_invert.c
@@ -72,18 +72,16 @@ static int gpu_shader_invert(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack
return GPU_stack_link(mat, "invert", in, out);
}
-void register_node_type_sh_invert(ListBase *lb)
+void register_node_type_sh_invert(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_invert_in, sh_node_invert_out);
node_type_size(&ntype, 90, 80, 100);
node_type_exec(&ntype, node_shader_exec_invert);
node_type_gpu(&ntype, gpu_shader_invert);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c
index 16b58e18761..bcd7fb8639d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c
+++ b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_layer_weight.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -48,11 +46,11 @@ static int node_shader_gpu_layer_weight(GPUMaterial *UNUSED(mat), bNode *UNUSED(
}
/* node type definition */
-void register_node_type_sh_layer_weight(ListBase *lb)
+void register_node_type_sh_layer_weight(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_layer_weight_in, sh_node_layer_weight_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_layer_weight(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_layer_weight);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_light_path.c b/source/blender/nodes/shader/nodes/node_shader_light_path.c
index d399a0bddd4..5d7a3014682 100644
--- a/source/blender/nodes/shader/nodes/node_shader_light_path.c
+++ b/source/blender/nodes/shader/nodes/node_shader_light_path.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -48,11 +46,11 @@ static int node_shader_gpu_light_path(GPUMaterial *mat, bNode *UNUSED(node), GPU
}
/* node type definition */
-void register_node_type_sh_light_path(ListBase *lb)
+void register_node_type_sh_light_path(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_light_path_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_light_path(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_light_path);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c
index 2fa885dcdd3..c2a58d49161 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mapping.c
+++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c
@@ -86,11 +86,11 @@ static int gpu_shader_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G
return GPU_stack_link(mat, "mapping", in, out, tmat, tmin, tmax, tdomin, tdomax);
}
-void register_node_type_sh_mapping(ListBase *lb)
+void register_node_type_sh_mapping(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_mapping_in, sh_node_mapping_out);
node_type_size(&ntype, 240, 160, 320);
@@ -99,5 +99,5 @@ void register_node_type_sh_mapping(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_mapping);
node_type_gpu(&ntype, gpu_shader_mapping);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c
index a74a2567844..decd3bb225f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_material.c
+++ b/source/blender/nodes/shader/nodes/node_shader_material.c
@@ -300,11 +300,11 @@ static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return 0;
}
-void register_node_type_sh_material(ListBase *lb)
+void register_node_type_sh_material(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MATERIAL, "Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
+ node_type_base(ttype, &ntype, SH_NODE_MATERIAL, "Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_material_in, sh_node_material_out);
node_type_size(&ntype, 120, 80, 240);
@@ -312,15 +312,15 @@ void register_node_type_sh_material(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_material);
node_type_gpu(&ntype, gpu_shader_material);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-void register_node_type_sh_material_ext(ListBase *lb)
+void register_node_type_sh_material_ext(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MATERIAL_EXT, "Extended Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
+ node_type_base(ttype, &ntype, SH_NODE_MATERIAL_EXT, "Extended Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_material_ext_in, sh_node_material_ext_out);
node_type_size(&ntype, 120, 80, 240);
@@ -328,7 +328,5 @@ void register_node_type_sh_material_ext(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_material);
node_type_gpu(&ntype, gpu_shader_material);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c
index 1c15c49a7da..c9234c626aa 100644
--- a/source/blender/nodes/shader/nodes/node_shader_math.c
+++ b/source/blender/nodes/shader/nodes/node_shader_math.c
@@ -236,11 +236,11 @@ static int gpu_shader_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUN
return 1;
}
-void register_node_type_sh_math(ListBase *lb)
+void register_node_type_sh_math(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_math_in, sh_node_math_out);
node_type_size(&ntype, 120, 110, 160);
@@ -249,7 +249,5 @@ void register_node_type_sh_math(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_math);
node_type_gpu(&ntype, gpu_shader_math);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
index 5d7ec9a23ab..e7350612b5b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
@@ -73,11 +73,11 @@ static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G
}
-void register_node_type_sh_mix_rgb(ListBase *lb)
+void register_node_type_sh_mix_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_mix_rgb_in, sh_node_mix_rgb_out);
node_type_size(&ntype, 100, 60, 150);
@@ -85,6 +85,5 @@ void register_node_type_sh_mix_rgb(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_mix_rgb);
node_type_gpu(&ntype, gpu_shader_mix_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c
index 5ce2a03f464..43dde9e5b91 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c
+++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -49,11 +47,11 @@ static int node_shader_gpu_mix_shader(GPUMaterial *mat, bNode *UNUSED(node), GPU
}
/* node type definition */
-void register_node_type_sh_mix_shader(ListBase *lb)
+void register_node_type_sh_mix_shader(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_mix_shader_in, sh_node_mix_shader_out);
node_type_size(&ntype, 150, 60, 200);
@@ -62,6 +60,5 @@ void register_node_type_sh_mix_shader(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_mix_shader);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c
index 40f2f65a193..f699268e939 100644
--- a/source/blender/nodes/shader/nodes/node_shader_normal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_normal.c
@@ -79,16 +79,16 @@ static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GP
return GPU_stack_link(mat, "normal", in, out, vec);
}
-void register_node_type_sh_normal(ListBase *lb)
+void register_node_type_sh_normal(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out);
node_type_init(&ntype, node_shader_init_normal);
node_type_exec(&ntype, node_shader_exec_normal);
node_type_gpu(&ntype, gpu_shader_normal);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c
index 22e3cab532d..5bc61859a0a 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output.c
@@ -78,18 +78,20 @@ static int gpu_shader_output(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack
return 1;
}
-void register_node_type_sh_output(ListBase *lb)
+void register_node_type_sh_output(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+ node_type_base(ttype, &ntype, SH_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_output_in, NULL);
node_type_size(&ntype, 80, 60, 200);
node_type_exec(&ntype, node_shader_exec_output);
node_type_gpu(&ntype, gpu_shader_output);
- nodeRegisterType(lb, &ntype);
-}
-
+ /* Do not allow muting output node. */
+ node_type_mute(&ntype, NULL, NULL);
+ node_type_gpu_mute(&ntype, NULL);
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c
index 2c954d1cf8f..cf2542c948c 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -37,11 +35,11 @@ static bNodeSocketTemplate sh_node_output_lamp_in[]= {
};
/* node type definition */
-void register_node_type_sh_output_lamp(ListBase *lb)
+void register_node_type_sh_output_lamp(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_OUTPUT_LAMP, "Lamp Output", NODE_CLASS_OUTPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_OUTPUT_LAMP, "Lamp Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_lamp_in, NULL);
node_type_size(&ntype, 120, 60, 200);
@@ -50,6 +48,9 @@ void register_node_type_sh_output_lamp(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, NULL);
- nodeRegisterType(lb, &ntype);
-};
+ /* Do not allow muting output node. */
+ node_type_mute(&ntype, NULL, NULL);
+ node_type_gpu_mute(&ntype, NULL);
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c
index 0059489fcc7..298df3bb66f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_material.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -50,11 +48,11 @@ static int node_shader_gpu_output_material(GPUMaterial *mat, bNode *UNUSED(node)
/* node type definition */
-void register_node_type_sh_output_material(ListBase *lb)
+void register_node_type_sh_output_material(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_material_in, NULL);
node_type_size(&ntype, 120, 60, 200);
@@ -63,6 +61,9 @@ void register_node_type_sh_output_material(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_output_material);
- nodeRegisterType(lb, &ntype);
-};
+ /* Do not allow muting output node. */
+ node_type_mute(&ntype, NULL, NULL);
+ node_type_gpu_mute(&ntype, NULL);
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.c b/source/blender/nodes/shader/nodes/node_shader_output_world.c
index 20bb3ab8f58..711f591c192 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_world.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_world.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -38,11 +36,11 @@ static bNodeSocketTemplate sh_node_output_world_in[]= {
};
/* node type definition */
-void register_node_type_sh_output_world(ListBase *lb)
+void register_node_type_sh_output_world(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_world_in, NULL);
node_type_size(&ntype, 120, 60, 200);
@@ -51,6 +49,9 @@ void register_node_type_sh_output_world(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, NULL);
- nodeRegisterType(lb, &ntype);
-};
+ /* Do not allow muting output node. */
+ node_type_mute(&ntype, NULL, NULL);
+ node_type_gpu_mute(&ntype, NULL);
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.c b/source/blender/nodes/shader/nodes/node_shader_rgb.c
index 58a00ed92e5..d0c52035f96 100644
--- a/source/blender/nodes/shader/nodes/node_shader_rgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_rgb.c
@@ -66,11 +66,11 @@ static int gpu_shader_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNo
return GPU_stack_link(mat, "set_rgba", in, out, vec);
}
-void register_node_type_sh_rgb(ListBase *lb)
+void register_node_type_sh_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_rgb_out);
node_type_init(&ntype, node_shader_init_rgb);
@@ -78,6 +78,5 @@ void register_node_type_sh_rgb(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_rgb);
node_type_gpu(&ntype, gpu_shader_rgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c
index 4f409bb3ec1..09371a8a5ae 100644
--- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c
+++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c
@@ -56,18 +56,18 @@ static int gpu_shader_seprgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack
return GPU_stack_link(mat, "separate_rgb", in, out);
}
-void register_node_type_sh_seprgb(ListBase *lb)
+void register_node_type_sh_seprgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_shader_exec_seprgb);
node_type_gpu(&ntype, gpu_shader_seprgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -96,17 +96,16 @@ static int gpu_shader_combrgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac
return GPU_stack_link(mat, "combine_rgb", in, out);
}
-void register_node_type_sh_combrgb(ListBase *lb)
+void register_node_type_sh_combrgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out);
node_type_size(&ntype, 80, 40, 140);
node_type_exec(&ntype, node_shader_exec_combrgb);
node_type_gpu(&ntype, gpu_shader_combrgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.c b/source/blender/nodes/shader/nodes/node_shader_squeeze.c
index 16a9ae8aedc..ded930659e5 100644
--- a/source/blender/nodes/shader/nodes/node_shader_squeeze.c
+++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.c
@@ -62,11 +62,11 @@ static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac
return GPU_stack_link(mat, "squeeze", in, out);
}
-void register_node_type_sh_squeeze(ListBase *lb)
+void register_node_type_sh_squeeze(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out);
node_type_size(&ntype, 120, 110, 160);
@@ -74,7 +74,5 @@ void register_node_type_sh_squeeze(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_squeeze);
node_type_gpu(&ntype, gpu_shader_squeeze);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
index a33e5599d77..8f67fb585c9 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -54,11 +52,11 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *UNUSED(node), GPUN
}
/* node type definition */
-void register_node_type_sh_tex_coord(ListBase *lb)
+void register_node_type_sh_tex_coord(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out);
node_type_size(&ntype, 150, 60, 200);
@@ -67,6 +65,5 @@ void register_node_type_sh_tex_coord(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_coord);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 ecf5a053ad3..dbdd6a8619b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -71,11 +69,11 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod
}
/* node type definition */
-void register_node_type_sh_tex_environment(ListBase *lb)
+void register_node_type_sh_tex_environment(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_environment_in, sh_node_tex_environment_out);
node_type_size(&ntype, 150, 60, 200);
@@ -84,6 +82,5 @@ void register_node_type_sh_tex_environment(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_environment);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 d78a5e9693a..a2403b6bdec 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -63,11 +61,11 @@ static int node_shader_gpu_tex_gradient(GPUMaterial *mat, bNode *node, GPUNodeSt
}
/* node type definition */
-void register_node_type_sh_tex_gradient(ListBase *lb)
+void register_node_type_sh_tex_gradient(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_GRADIENT, "Gradient Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_GRADIENT, "Gradient Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_gradient_in, sh_node_tex_gradient_out);
node_type_size(&ntype, 150, 60, 200);
@@ -76,6 +74,5 @@ void register_node_type_sh_tex_gradient(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_gradient);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 75b5f26b252..aa679b4e04e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -71,11 +69,11 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, GPUNodeStack
}
/* node type definition */
-void register_node_type_sh_tex_image(ListBase *lb)
+void register_node_type_sh_tex_image(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_image_in, sh_node_tex_image_out);
node_type_size(&ntype, 150, 60, 200);
@@ -84,6 +82,5 @@ void register_node_type_sh_tex_image(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_image);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 6c021a7f900..3a270220667 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -68,11 +66,11 @@ static int node_shader_gpu_tex_magic(GPUMaterial *mat, bNode *node, GPUNodeStack
}
/* node type definition */
-void register_node_type_sh_tex_magic(ListBase *lb)
+void register_node_type_sh_tex_magic(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_magic_in, sh_node_tex_magic_out);
node_type_size(&ntype, 150, 60, 200);
@@ -81,6 +79,5 @@ void register_node_type_sh_tex_magic(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_magic);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 4aefea3e383..015b78687fd 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -69,11 +67,11 @@ static int node_shader_gpu_tex_musgrave(GPUMaterial *mat, bNode *node, GPUNodeSt
}
/* node type definition */
-void register_node_type_sh_tex_musgrave(ListBase *lb)
+void register_node_type_sh_tex_musgrave(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_MUSGRAVE, "Musgrave Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_MUSGRAVE, "Musgrave Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_musgrave_in, sh_node_tex_musgrave_out);
node_type_size(&ntype, 150, 60, 200);
@@ -82,6 +80,5 @@ void register_node_type_sh_tex_musgrave(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_musgrave);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 6c27384a24d..bb365cf5a33 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -65,11 +63,11 @@ static int node_shader_gpu_tex_noise(GPUMaterial *mat, bNode *node, GPUNodeStack
}
/* node type definition */
-void register_node_type_sh_tex_noise(ListBase *lb)
+void register_node_type_sh_tex_noise(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE, 0);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_noise_in, sh_node_tex_noise_out);
node_type_size(&ntype, 150, 60, 200);
@@ -78,6 +76,5 @@ void register_node_type_sh_tex_noise(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_noise);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 1abcec86b12..a4131f3ca6c 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -65,11 +63,11 @@ static int node_shader_gpu_tex_sky(GPUMaterial *mat, bNode *node, GPUNodeStack *
}
/* node type definition */
-void register_node_type_sh_tex_sky(ListBase *lb)
+void register_node_type_sh_tex_sky(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_SKY, "Sky Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_SKY, "Sky Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_sky_in, sh_node_tex_sky_out);
node_type_size(&ntype, 150, 60, 200);
@@ -78,6 +76,5 @@ void register_node_type_sh_tex_sky(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_sky);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 6be3a2e928b..9adaab22b03 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -64,11 +62,11 @@ static int node_shader_gpu_tex_voronoi(GPUMaterial *mat, bNode *node, GPUNodeSta
}
/* node type definition */
-void register_node_type_sh_tex_voronoi(ListBase *lb)
+void register_node_type_sh_tex_voronoi(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_voronoi_in, sh_node_tex_voronoi_out);
node_type_size(&ntype, 150, 60, 200);
@@ -77,6 +75,5 @@ void register_node_type_sh_tex_voronoi(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_voronoi);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
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 ed0aa230721..d359a407bc0 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -67,11 +65,11 @@ static int node_shader_gpu_tex_wave(GPUMaterial *mat, bNode *node, GPUNodeStack
}
/* node type definition */
-void register_node_type_sh_tex_wave(ListBase *lb)
+void register_node_type_sh_tex_wave(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEX_WAVE, "Wave Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_WAVE, "Wave Texture", NODE_CLASS_TEXTURE, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_wave_in, sh_node_tex_wave_out);
node_type_size(&ntype, 150, 60, 200);
@@ -80,6 +78,5 @@ void register_node_type_sh_tex_wave(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_tex_wave);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c
index dbf9fdbdb7e..02818496dab 100644
--- a/source/blender/nodes/shader/nodes/node_shader_texture.c
+++ b/source/blender/nodes/shader/nodes/node_shader_texture.c
@@ -51,6 +51,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
if(data && node->id) {
ShadeInput *shi= ((ShaderCallData *)data)->shi;
TexResult texres;
+ bNodeSocket *sock_vector= node->inputs.first;
float vec[3], nor[3]={0.0f, 0.0f, 0.0f};
int retval;
short which_output = node->custom1;
@@ -63,7 +64,8 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
texres.nor= nor;
texres.tr= texres.tg= texres.tb= 0.0f;
- if(in[0]->hasinput) {
+ /* don't use in[0]->hasinput, see material node for explanation */
+ if(sock_vector->link) {
nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
if(in[0]->datatype==NS_OSA_VECTORS) {
@@ -131,18 +133,16 @@ static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G
return 0;
}
-void register_node_type_sh_texture(ListBase *lb)
+void register_node_type_sh_texture(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
+ node_type_base(ttype, &ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_texture_in, sh_node_texture_out);
node_type_size(&ntype, 120, 80, 240);
node_type_exec(&ntype, node_shader_exec_texture);
node_type_gpu(&ntype, gpu_shader_texture);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
index 94afd09274a..f0a94928985 100644
--- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
@@ -71,11 +71,11 @@ static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array));
}
-void register_node_type_sh_valtorgb(ListBase *lb)
+void register_node_type_sh_valtorgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out);
node_type_size(&ntype, 240, 200, 300);
@@ -84,7 +84,7 @@ void register_node_type_sh_valtorgb(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_valtorgb);
node_type_gpu(&ntype, gpu_shader_valtorgb);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -112,18 +112,16 @@ static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStac
return GPU_stack_link(mat, "rgbtobw", in, out);
}
-void register_node_type_sh_rgbtobw(ListBase *lb)
+void register_node_type_sh_rgbtobw(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out);
node_type_size(&ntype, 80, 40, 120);
node_type_exec(&ntype, node_shader_exec_rgbtobw);
node_type_gpu(&ntype, gpu_shader_rgbtobw);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_value.c b/source/blender/nodes/shader/nodes/node_shader_value.c
index 8f490f4953b..3196ce5cbe4 100644
--- a/source/blender/nodes/shader/nodes/node_shader_value.c
+++ b/source/blender/nodes/shader/nodes/node_shader_value.c
@@ -66,11 +66,11 @@ static int gpu_shader_value(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPU
return GPU_stack_link(mat, "set_value", in, out, vec);
}
-void register_node_type_sh_value(ListBase *lb)
+void register_node_type_sh_value(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_value_out);
node_type_init(&ntype, node_shader_init_value);
@@ -78,7 +78,5 @@ void register_node_type_sh_value(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_value);
node_type_gpu(&ntype, gpu_shader_value);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c
index bb56037b4d4..75dbff11b6e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c
+++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c
@@ -130,11 +130,11 @@ static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
return 1;
}
-void register_node_type_sh_vect_math(ListBase *lb)
+void register_node_type_sh_vect_math(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_vect_math_in, sh_node_vect_math_out);
node_type_size(&ntype, 80, 75, 140);
@@ -143,7 +143,5 @@ void register_node_type_sh_vect_math(ListBase *lb)
node_type_exec(&ntype, node_shader_exec_vect_math);
node_type_gpu(&ntype, gpu_shader_vect_math);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
-
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c b/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c
index 9f4c1447f65..6eb3178709f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c
@@ -1,6 +1,4 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -48,11 +46,11 @@ static int node_shader_gpu_volume_isotropic(GPUMaterial *UNUSED(mat), bNode *UNU
}
/* node type definition */
-void register_node_type_sh_volume_isotropic(ListBase *lb)
+void register_node_type_sh_volume_isotropic(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_VOLUME_ISOTROPIC, "Isotropic Volume", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_VOLUME_ISOTROPIC, "Isotropic Volume", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_volume_isotropic_in, sh_node_volume_isotropic_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_volume_isotropic(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_volume_isotropic);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c b/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c
index 910933bb5fa..3d2d4fc689e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c
@@ -1,12 +1,10 @@
-/**
- * $Id: node_shader_output.c 32517 2010-10-16 14:32:17Z campbellbarton $
- *
+/*
* ***** 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
@@ -48,11 +46,11 @@ static int node_shader_gpu_volume_transparent(GPUMaterial *UNUSED(mat), bNode *U
}
/* node type definition */
-void register_node_type_sh_volume_transparent(ListBase *lb)
+void register_node_type_sh_volume_transparent(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, SH_NODE_VOLUME_TRANSPARENT, "Transparent Volume", NODE_CLASS_SHADER, 0);
+ node_type_base(ttype, &ntype, SH_NODE_VOLUME_TRANSPARENT, "Transparent Volume", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_volume_transparent_in, sh_node_volume_transparent_out);
node_type_size(&ntype, 150, 60, 200);
@@ -61,6 +59,5 @@ void register_node_type_sh_volume_transparent(ListBase *lb)
node_type_exec(&ntype, NULL);
node_type_gpu(&ntype, node_shader_gpu_volume_transparent);
- nodeRegisterType(lb, &ntype);
-};
-
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c
index e863e9f6e0f..1e171bd8a46 100644
--- a/source/blender/nodes/texture/node_texture_tree.c
+++ b/source/blender/nodes/texture/node_texture_tree.c
@@ -111,7 +111,11 @@ bNodeTreeType ntreeType_Texture = {
/* local_sync */ local_sync,
/* local_merge */ NULL,
/* update */ NULL,
- /* update_node */ NULL
+ /* update_node */ NULL,
+ /* validate_link */ NULL,
+ /* mute node */ node_tex_pass_on,
+ /* mute links node */ node_mute_get_links,
+ /* gpu mute node */ NULL
};
int ntreeTexTagAnimated(bNodeTree *ntree)
diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c
index c3d298d1ecd..06ee4b0a53d 100644
--- a/source/blender/nodes/texture/node_texture_util.c
+++ b/source/blender/nodes/texture/node_texture_util.c
@@ -143,6 +143,98 @@ void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn, TexC
dg->type = out->sockettype;
}
+/* Used for muted nodes, just pass the TexDelegate data from input to output…
+ * XXX That *%!?¿§ callback TextureDelegate system is a nightmare here!
+ * So I have to use an ugly hack (checking inputs twice!)… Yuk!
+ * I’d be very happy if someone can imagine a better solution
+ * (without changing the whole stuff).
+ * WARNING: These are only suitable for default muting behavior. If you want a custom
+ * one for your texnode, you must not use them!
+ */
+static void passonvalfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
+{
+ bNodeSocket *sock;
+ int i;
+
+ /* test the inputs */
+ for(i=0, sock = node->inputs.first; sock; sock = sock->next, i++) {
+ if(sock->link && sock->type==SOCK_FLOAT && in) {
+ out[0] = tex_input_value(in[i], p, thread);
+ break;
+ }
+ }
+}
+
+static void passonvecfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
+{
+ bNodeSocket *sock;
+ int i;
+
+ /* test the inputs */
+ for(i=0, sock = node->inputs.first; sock; sock = sock->next, i++) {
+ if(sock->link && sock->type==SOCK_VECTOR && in) {
+ tex_input_vec(out, in[i], p, thread);
+ break;
+ }
+ }
+}
+
+static void passoncolfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
+{
+ bNodeSocket *sock;
+ int i;
+
+ /* test the inputs */
+ for(i=0, sock = node->inputs.first; sock; sock = sock->next, i++) {
+ if(sock->link && sock->type==SOCK_RGBA && in) {
+ tex_input_rgba(out, in[i], p, thread);
+ break;
+ }
+ }
+}
+
+void node_tex_pass_on(void *data, int UNUSED(thread), struct bNode *node, void *UNUSED(nodedata),
+ struct bNodeStack **in, struct bNodeStack **out)
+{
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
+ int i;
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return;
+
+ /* Get default muting links (as bNodeStack pointers). */
+ links = node->typeinfo->mutelinksfunc(NULL, node, in, out, NULL, NULL);
+
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ /* XXX This breaks the generality of the system.
+ * Again, unfortunately, I see no other way to do due to tex nodes behavior...
+ */
+ void (*passonfn)(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread);
+ switch(((bNodeStack*)(lnk->in))->sockettype) {
+ case SOCK_FLOAT:
+ passonfn = passonvalfn;
+ break;
+ case SOCK_VECTOR:
+ passonfn = passonvecfn;
+ break;
+ case SOCK_RGBA:
+ passonfn = passoncolfn;
+ break;
+ default:
+ passonfn = NULL;
+ }
+ for(i = 0; i < lnk->num_outs; i++) {
+ if(((bNodeStack*)(lnk->in))->data && passonfn)
+ tex_output(node, in, ((bNodeStack*)(lnk->outs))+i, passonfn, data);
+ }
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(i > 1)
+ MEM_freeN(lnk->outs);
+ }
+ BLI_freelistN(&links);
+}
+
void ntreeTexCheckCyclics(struct bNodeTree *ntree)
{
bNode *node;
diff --git a/source/blender/nodes/texture/node_texture_util.h b/source/blender/nodes/texture/node_texture_util.h
index 766cc73c330..5095a9799e4 100644
--- a/source/blender/nodes/texture/node_texture_util.h
+++ b/source/blender/nodes/texture/node_texture_util.h
@@ -119,4 +119,6 @@ void tex_do_preview(bNode *node, float *coord, float *col);
void params_from_cdata(TexParams *out, TexCallData *in);
+void node_tex_pass_on(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out);
+
#endif
diff --git a/source/blender/nodes/texture/nodes/node_texture_at.c b/source/blender/nodes/texture/nodes/node_texture_at.c
index 65787891602..33548be3208 100644
--- a/source/blender/nodes/texture/nodes/node_texture_at.c
+++ b/source/blender/nodes/texture/nodes/node_texture_at.c
@@ -58,14 +58,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_at(ListBase *lb)
+void register_node_type_tex_at(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_AT, "At", NODE_CLASS_DISTORT, 0);
+ node_type_base(ttype, &ntype, TEX_NODE_AT, "At", NODE_CLASS_DISTORT, 0);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c
index 0700085a787..b4b25a10537 100644
--- a/source/blender/nodes/texture/nodes/node_texture_bricks.c
+++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c
@@ -119,15 +119,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_bricks(ListBase *lb)
+void register_node_type_tex_bricks(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 150, 60, 150);
node_type_init(&ntype, init);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c
index aebd3f2a05c..6b5848270ba 100644
--- a/source/blender/nodes/texture/nodes/node_texture_checker.c
+++ b/source/blender/nodes/texture/nodes/node_texture_checker.c
@@ -69,14 +69,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_checker(ListBase *lb)
+void register_node_type_tex_checker(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 100, 60, 150);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c
index 0b8ee031d4f..9a66ecb5ffb 100644
--- a/source/blender/nodes/texture/nodes/node_texture_common.c
+++ b/source/blender/nodes/texture/nodes/node_texture_common.c
@@ -125,11 +125,11 @@ static void group_execute(void *data, int thread, struct bNode *node, void *node
ntreeReleaseThreadStack(nts);
}
-void register_node_type_tex_group(ListBase *lb)
+void register_node_type_tex_group(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
+ node_type_base(ttype, &ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -140,7 +140,7 @@ void register_node_type_tex_group(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, group_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
@@ -186,11 +186,11 @@ static void forloop_execute(void *data, int thread, struct bNode *node, void *no
ntreeReleaseThreadStack(nts);
}
-void register_node_type_tex_forloop(ListBase *lb)
+void register_node_type_tex_forloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -202,7 +202,7 @@ void register_node_type_tex_forloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
@@ -248,11 +248,11 @@ static void whileloop_execute(void *data, int thread, struct bNode *node, void *
ntreeReleaseThreadStack(nts);
}
-void register_node_type_tex_whileloop(ListBase *lb)
+void register_node_type_tex_whileloop(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@@ -264,6 +264,6 @@ void register_node_type_tex_whileloop(ListBase *lb)
node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
#endif
diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c
index d2a6cd0cb42..5256db98d78 100644
--- a/source/blender/nodes/texture/nodes/node_texture_compose.c
+++ b/source/blender/nodes/texture/nodes/node_texture_compose.c
@@ -57,14 +57,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_compose(ListBase *lb)
+void register_node_type_tex_compose(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_COMPOSE, "Compose RGBA", NODE_CLASS_OP_COLOR, 0);
+ node_type_base(ttype, &ntype, TEX_NODE_COMPOSE, "Compose RGBA", NODE_CLASS_OP_COLOR, 0);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 100, 60, 150);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_coord.c b/source/blender/nodes/texture/nodes/node_texture_coord.c
index a86324e9f7d..6d6f31d6aaa 100644
--- a/source/blender/nodes/texture/nodes/node_texture_coord.c
+++ b/source/blender/nodes/texture/nodes/node_texture_coord.c
@@ -50,15 +50,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &vectorfn, data);
}
-void register_node_type_tex_coord(ListBase *lb)
+void register_node_type_tex_coord(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, outputs);
node_type_size(&ntype, 120, 110, 160);
node_type_storage(&ntype, "node_coord", NULL, NULL);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c
index b14036ace5b..08e7efc1606 100644
--- a/source/blender/nodes/texture/nodes/node_texture_curves.c
+++ b/source/blender/nodes/texture/nodes/node_texture_curves.c
@@ -66,18 +66,18 @@ static void time_init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUS
node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
}
-void register_node_type_tex_curve_time(ListBase *lb)
+void register_node_type_tex_curve_time(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_CURVE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_CURVE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, time_outputs);
node_type_size(&ntype, 140, 100, 320);
node_type_init(&ntype, time_init);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, time_exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
/* **************** CURVE RGB ******************** */
@@ -110,17 +110,16 @@ static void rgb_init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSE
node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
}
-void register_node_type_tex_curve_rgb(ListBase *lb)
+void register_node_type_tex_curve_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, rgb_inputs, rgb_outputs);
node_type_size(&ntype, 200, 140, 320);
node_type_init(&ntype, rgb_init);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, rgb_exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/texture/nodes/node_texture_decompose.c b/source/blender/nodes/texture/nodes/node_texture_decompose.c
index e83e6a718ef..435b87164c4 100644
--- a/source/blender/nodes/texture/nodes/node_texture_decompose.c
+++ b/source/blender/nodes/texture/nodes/node_texture_decompose.c
@@ -78,14 +78,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[3], &valuefn_a, data);
}
-void register_node_type_tex_decompose(ListBase *lb)
+void register_node_type_tex_decompose(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_DECOMPOSE, "Decompose RGBA", NODE_CLASS_OP_COLOR, 0);
+ node_type_base(ttype, &ntype, TEX_NODE_DECOMPOSE, "Decompose RGBA", NODE_CLASS_OP_COLOR, 0);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 100, 60, 150);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_distance.c b/source/blender/nodes/texture/nodes/node_texture_distance.c
index c0a9950e761..a2c1f41c0de 100644
--- a/source/blender/nodes/texture/nodes/node_texture_distance.c
+++ b/source/blender/nodes/texture/nodes/node_texture_distance.c
@@ -61,15 +61,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &valuefn, data);
}
-void register_node_type_tex_distance(ListBase *lb)
+void register_node_type_tex_distance(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_DISTANCE, "Distance", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_DISTANCE, "Distance", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 120, 110, 160);
node_type_storage(&ntype, "node_distance", NULL, NULL);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
index 3346592f7d3..e566fb0298a 100644
--- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
+++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
@@ -92,14 +92,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_hue_sat(ListBase *lb)
+void register_node_type_tex_hue_sat(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 150, 80, 250);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c
index 0ead3a3dec2..0acfe62ed82 100644
--- a/source/blender/nodes/texture/nodes/node_texture_image.c
+++ b/source/blender/nodes/texture/nodes/node_texture_image.c
@@ -95,16 +95,16 @@ static void init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(nt
iuser->ok= 1;
}
-void register_node_type_tex_image(ListBase *lb)
+void register_node_type_tex_image(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, NULL, outputs);
node_type_size(&ntype, 120, 80, 300);
node_type_init(&ntype, init);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c
index 5ee60d02e32..297675f498c 100644
--- a/source/blender/nodes/texture/nodes/node_texture_invert.c
+++ b/source/blender/nodes/texture/nodes/node_texture_invert.c
@@ -63,15 +63,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_invert(ListBase *lb)
+void register_node_type_tex_invert(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 90, 80, 100);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c
index 74b9dcdd30a..4659aa2b6c0 100644
--- a/source/blender/nodes/texture/nodes/node_texture_math.c
+++ b/source/blender/nodes/texture/nodes/node_texture_math.c
@@ -184,17 +184,16 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &valuefn, data);
}
-void register_node_type_tex_math(ListBase *lb)
+void register_node_type_tex_math(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 120, 110, 160);
node_type_label(&ntype, node_math_label);
node_type_storage(&ntype, "node_math", NULL, NULL);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
index e3b5119c797..13816088ea7 100644
--- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
+++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
@@ -64,15 +64,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_mix_rgb(ListBase *lb)
+void register_node_type_tex_mix_rgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 100, 60, 150);
node_type_label(&ntype, node_blend_label);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c
index 42ee2847d06..0ed6d232b81 100644
--- a/source/blender/nodes/texture/nodes/node_texture_output.c
+++ b/source/blender/nodes/texture/nodes/node_texture_output.c
@@ -157,16 +157,19 @@ static void copy(bNode *orig, bNode *new)
assign_index(new);
}
-void register_node_type_tex_output(ListBase *lb)
+void register_node_type_tex_output(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, NULL);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, init);
node_type_storage(&ntype, "TexNodeOutput", node_free_standard_storage, copy);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ /* Do not allow muting output. */
+ node_type_mute(&ntype, NULL, NULL);
+
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c
index 3012d313db5..fac8b02fb85 100644
--- a/source/blender/nodes/texture/nodes/node_texture_proc.c
+++ b/source/blender/nodes/texture/nodes/node_texture_proc.c
@@ -296,18 +296,18 @@ static void init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(nt
/* Node type definitions */
#define TexDef(TEXTYPE, outputs, name, Name) \
-void register_node_type_tex_proc_##name(ListBase *lb) \
+void register_node_type_tex_proc_##name(bNodeTreeType *ttype) \
{ \
static bNodeType ntype; \
\
- node_type_base(&ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS); \
+ node_type_base(ttype, &ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS); \
node_type_socket_templates(&ntype, name##_inputs, outputs); \
node_type_size(&ntype, 140, 80, 140); \
node_type_init(&ntype, init); \
node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
node_type_exec(&ntype, name##_exec); \
\
- nodeRegisterType(lb, &ntype); \
+ nodeRegisterType(ttype, &ntype); \
}
#define C outputs_color_only
diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c
index a3f69286269..d1c9cca3f3c 100644
--- a/source/blender/nodes/texture/nodes/node_texture_rotate.c
+++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c
@@ -95,14 +95,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_rotate(ListBase *lb)
+void register_node_type_tex_rotate(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 140, 100, 320);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_scale.c b/source/blender/nodes/texture/nodes/node_texture_scale.c
index f42b3addc91..f8790d414c9 100644
--- a/source/blender/nodes/texture/nodes/node_texture_scale.c
+++ b/source/blender/nodes/texture/nodes/node_texture_scale.c
@@ -68,14 +68,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_scale(ListBase *lb)
+void register_node_type_tex_scale(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 90, 80, 100);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c
index 667570582fe..3a0f11d5417 100644
--- a/source/blender/nodes/texture/nodes/node_texture_texture.c
+++ b/source/blender/nodes/texture/nodes/node_texture_texture.c
@@ -95,14 +95,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_texture(ListBase *lb)
+void register_node_type_tex_texture(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 120, 80, 240);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_translate.c b/source/blender/nodes/texture/nodes/node_texture_translate.c
index 8d09b4363f8..61b0702b333 100644
--- a/source/blender/nodes/texture/nodes/node_texture_translate.c
+++ b/source/blender/nodes/texture/nodes/node_texture_translate.c
@@ -64,14 +64,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-void register_node_type_tex_translate(ListBase *lb)
+void register_node_type_tex_translate(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 90, 80, 100);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c
index 28b0a19c5a9..c8159060433 100644
--- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c
+++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c
@@ -80,14 +80,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &normalfn, data);
}
-void register_node_type_tex_valtonor(ListBase *lb)
+void register_node_type_tex_valtonor(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_VALTONOR, "Value to Normal", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_VALTONOR, "Value to Normal", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 90, 80, 100);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
index 0a6cdbd2024..c0efa43c14f 100644
--- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
+++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
@@ -62,18 +62,18 @@ static void valtorgb_init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *
node->storage = add_colorband(1);
}
-void register_node_type_tex_valtorgb(ListBase *lb)
+void register_node_type_tex_valtorgb(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, TEX_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
node_type_socket_templates(&ntype, valtorgb_in, valtorgb_out);
node_type_size(&ntype, 240, 200, 300);
node_type_init(&ntype, valtorgb_init);
node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage);
node_type_exec(&ntype, valtorgb_exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
/* **************** RGBTOBW ******************** */
@@ -100,15 +100,14 @@ static void rgbtobw_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **
tex_output(node, in, out[0], &rgbtobw_valuefn, data);
}
-void register_node_type_tex_rgbtobw(ListBase *lb)
+void register_node_type_tex_rgbtobw(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
+ node_type_base(ttype, &ntype, TEX_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
node_type_socket_templates(&ntype, rgbtobw_in, rgbtobw_out);
node_type_size(&ntype, 80, 40, 120);
node_type_exec(&ntype, rgbtobw_exec);
- nodeRegisterType(lb, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
-
diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c
index a9670bfa78b..a588f13f18f 100644
--- a/source/blender/nodes/texture/nodes/node_texture_viewer.c
+++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c
@@ -56,14 +56,17 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
}
}
-void register_node_type_tex_viewer(ListBase *lb)
+void register_node_type_tex_viewer(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(&ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
+ node_type_base(ttype, &ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
node_type_socket_templates(&ntype, inputs, outputs);
node_type_size(&ntype, 100, 60, 150);
node_type_exec(&ntype, exec);
- nodeRegisterType(lb, &ntype);
+ /* Do not allow muting viewer node. */
+ node_type_mute(&ntype, NULL, NULL);
+
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 29e0185c2f2..51f9063c289 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -74,7 +74,7 @@ void BPY_modules_load_user(struct bContext *C);
void BPY_app_handlers_reset(const short do_all);
void BPY_driver_reset(void);
-float BPY_driver_exec(struct ChannelDriver *driver);
+float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime);
int BPY_button_exec(struct bContext *C, const char *expr, double *value, const short verbose);
int BPY_string_exec(struct bContext *C, const char *expr);
diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt
index 847a0d19a7f..bd9731a277a 100644
--- a/source/blender/python/generic/CMakeLists.txt
+++ b/source/blender/python/generic/CMakeLists.txt
@@ -33,17 +33,17 @@ set(INC_SYS
)
set(SRC
- IDProp.c
bgl.c
blf_py_api.c
bpy_internal_import.c
+ idprop_py_api.c
noise_py_api.c
py_capi_utils.c
- IDProp.h
bgl.h
blf_py_api.h
bpy_internal_import.h
+ idprop_py_api.h
noise_py_api.h
py_capi_utils.h
)
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/idprop_py_api.c
index 6d869a7eb1f..73d954057c9 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -21,14 +21,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/python/generic/IDProp.c
+/** \file blender/python/generic/idprop_py_api.c
* \ingroup pygen
*/
#include <Python.h>
-#include "IDProp.h"
+#include "idprop_py_api.h"
#include "MEM_guardedalloc.h"
#include "BLI_string.h"
@@ -49,72 +49,114 @@ extern PyTypeObject BPy_IDGroup_Type;
/*********************** ID Property Main Wrapper Stuff ***************/
-/* use for both array and group */
-static long BPy_IDGroup_hash(BPy_IDProperty *self)
+/* ----------------------------------------------------------------------------
+ * static conversion functions to avoid duplicate code, no type checking.
+ */
+
+static PyObject *idprop_py_from_idp_string(IDProperty *prop)
{
- return _Py_HashPointer(self->prop);
+ if (prop->subtype == IDP_STRING_SUB_BYTE) {
+ return PyBytes_FromStringAndSize(IDP_Array(prop), prop->len);
+ }
+ else {
+#ifdef USE_STRING_COERCE
+ return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
+#else
+ return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
+#endif
+ }
}
-static PyObject *BPy_IDGroup_repr(BPy_IDProperty *self)
+static PyObject *idprop_py_from_idp_int(IDProperty *prop)
{
- return PyUnicode_FromFormat( "<bpy id property from \"%s\">", self->id->name);
+ return PyLong_FromLong((long)prop->data.val);
}
-PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
+static PyObject *idprop_py_from_idp_float(IDProperty *prop)
{
- switch ( prop->type ) {
- case IDP_STRING:
-#ifdef USE_STRING_COERCE
- return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
-#else
- return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
-#endif
- case IDP_INT:
- return PyLong_FromLong( (long)prop->data.val );
- case IDP_FLOAT:
- return PyFloat_FromDouble( (double)(*(float*)(&prop->data.val)) );
- case IDP_DOUBLE:
- return PyFloat_FromDouble( (*(double*)(&prop->data.val)) );
- case IDP_GROUP:
- /*blegh*/
- {
- BPy_IDProperty *group = PyObject_New(BPy_IDProperty, &BPy_IDGroup_Type);
- group->id = id;
- group->prop = prop;
- return (PyObject*) group;
- }
- case IDP_ARRAY:
- {
- BPy_IDProperty *array = PyObject_New(BPy_IDProperty, &BPy_IDArray_Type);
- array->id = id;
- array->prop = prop;
- return (PyObject*) array;
- }
- case IDP_IDPARRAY: /* this could be better a internal type */
- {
- PyObject *seq = PyList_New(prop->len), *wrap;
- IDProperty *array= IDP_IDPArray(prop);
- int i;
+ return PyFloat_FromDouble((double)(*(float*)(&prop->data.val)));
+}
+
+static PyObject *idprop_py_from_idp_double(IDProperty *prop)
+{
+ 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);
+ group->id = id;
+ group->prop = prop;
+ group->parent = parent; /* can be NULL */
+ return (PyObject*) group;
+}
+
+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;
+}
- if (!seq) {
- PyErr_Format(PyExc_RuntimeError, "BPy_IDGroup_MapDataToPy, IDP_IDPARRAY: PyList_New(%d) failed", prop->len);
- return NULL;
- }
+static PyObject *idprop_py_from_idp_idparray(ID *id, IDProperty *prop)
+{
+ PyObject *seq = PyList_New(prop->len), *wrap;
+ IDProperty *array= IDP_IDPArray(prop);
+ int i;
- for (i=0; i<prop->len; i++) {
- wrap= BPy_IDGroup_WrapData(id, array++);
+ if (!seq) {
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: IDP_IDPARRAY: PyList_New(%d) failed",
+ __func__, prop->len);
+ return NULL;
+ }
- if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
- return NULL;
+ for (i=0; i<prop->len; i++) {
+ wrap= BPy_IDGroup_WrapData(id, array++, prop);
- PyList_SET_ITEM(seq, i, wrap);
- }
+ if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
+ return NULL;
- return seq;
- }
- /* case IDP_IDPARRAY: TODO */
+ PyList_SET_ITEM(seq, i, wrap);
+ }
+
+ return seq;
+}
+
+/* -------------------------------------------------------------------------- */
+
+/* use for both array and group */
+static long BPy_IDGroup_hash(BPy_IDProperty *self)
+{
+ return _Py_HashPointer(self->prop);
+}
+
+static PyObject *BPy_IDGroup_repr(BPy_IDProperty *self)
+{
+ 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_idparray(id, prop);
+ case IDP_IDPARRAY: /* this could be better a internal type */
+ idprop_py_from_idp_array(id, prop);
+ default:
+ Py_RETURN_NONE;
}
- Py_RETURN_NONE;
}
#if 0 /* UNUSED, currenly assignment overwrites into new properties, rather than setting in-place */
@@ -128,6 +170,7 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
PyErr_SetString(PyExc_TypeError, "expected a string!");
return -1;
}
+ /* NOTE: if this code is enabled, bytes support needs to be added */
#ifdef USE_STRING_COERCE
{
int alloc_len;
@@ -260,8 +303,7 @@ static PyObject *BPy_IDGroup_Map_GetItem(BPy_IDProperty *self, PyObject *item)
return NULL;
}
- return BPy_IDGroup_WrapData(self->id, idprop);
-
+ return BPy_IDGroup_WrapData(self->id, idprop, self->prop);
}
/*returns NULL on success, error string on failure*/
@@ -323,23 +365,33 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
if (PyFloat_Check(ob)) {
val.d = PyFloat_AsDouble(ob);
- prop = IDP_New(IDP_DOUBLE, val, name);
+ prop = IDP_New(IDP_DOUBLE, &val, name);
}
else if (PyLong_Check(ob)) {
val.i = (int) PyLong_AsSsize_t(ob);
- prop = IDP_New(IDP_INT, val, name);
+ prop = IDP_New(IDP_INT, &val, name);
}
else if (PyUnicode_Check(ob)) {
#ifdef USE_STRING_COERCE
PyObject *value_coerce= NULL;
- val.str = (char *)PyC_UnicodeAsByte(ob, &value_coerce);
- prop = IDP_New(IDP_STRING, val, name);
+ val.string.str = (char *)PyC_UnicodeAsByte(ob, &value_coerce);
+ val.string.subtype = IDP_STRING_SUB_UTF8;
+ prop = IDP_New(IDP_STRING, &val, name);
Py_XDECREF(value_coerce);
#else
val.str = _PyUnicode_AsString(ob);
prop = IDP_New(IDP_STRING, val, name);
#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;
+
+ 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;
+ }
else if (PySequence_Check(ob)) {
PyObject *item;
int i;
@@ -355,7 +407,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
switch(val.array.type) {
case IDP_DOUBLE:
- prop = IDP_New(IDP_ARRAY, val, name);
+ 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);
@@ -363,7 +415,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
}
break;
case IDP_INT:
- prop = IDP_New(IDP_ARRAY, val, name);
+ 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);
@@ -393,7 +445,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
/*we allocate the group first; if we hit any invalid data,
we can delete it easily enough.*/
- prop = IDP_New(IDP_GROUP, val, name);
+ prop = IDP_New(IDP_GROUP, &val, name);
len = PyMapping_Length(ob);
for (i=0; i<len; i++) {
key = PySequence_GetItem(keys, i);
@@ -489,108 +541,109 @@ static PyObject *BPy_IDGroup_iter(BPy_IDProperty *self)
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:
-#ifdef USE_STRING_COERCE
- return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
-#else
- return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
-#endif
- break;
+ 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_FLOAT:
- return PyFloat_FromDouble(*((float*)&prop->data.val));
+ {
+ 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:
- return PyFloat_FromDouble(*((double*)&prop->data.val));
+ {
+ 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:
- return PyLong_FromSsize_t( prop->data.val );
- break;
- case IDP_ARRAY:
{
- PyObject *seq = PyList_New(prop->len);
- int i;
-
- if (!seq) {
- PyErr_Format(PyExc_RuntimeError, "BPy_IDGroup_MapDataToPy, IDP_ARRAY: PyList_New(%d) failed", prop->len);
- return NULL;
+ 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;
+ }
- 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_SetString(PyExc_RuntimeError, "invalid/corrupt array type!");
- Py_DECREF(seq);
- return NULL;
- }
+ return seq;
+ }
+ case IDP_IDPARRAY:
+ {
+ PyObject *seq = PyList_New(prop->len), *wrap;
+ IDProperty *array= IDP_IDPArray(prop);
+ int i;
- return seq;
+ if (!seq) {
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: IDP_IDPARRAY: PyList_New(%d) failed",
+ __func__, prop->len);
+ return NULL;
}
- case IDP_IDPARRAY:
- {
- PyObject *seq = PyList_New(prop->len), *wrap;
- IDProperty *array= IDP_IDPArray(prop);
- int i;
-
- if (!seq) {
- PyErr_Format(PyExc_RuntimeError, "BPy_IDGroup_MapDataToPy, IDP_IDPARRAY: PyList_New(%d) failed", 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);
- }
- return seq;
+ PyList_SET_ITEM(seq, i, wrap);
}
- case IDP_GROUP:
- {
- PyObject *dict = PyDict_New(), *wrap;
- IDProperty *loop;
+ return seq;
+ }
+ 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);
- }
- return dict;
+ PyDict_SetItemString(dict, loop->name, wrap);
+ Py_DECREF(wrap);
}
+ return dict;
+ }
}
- PyErr_Format(PyExc_RuntimeError, "eek!! '%s' property exists with a bad type code '%d' !!!", prop->name, prop->type);
+ PyErr_Format(PyExc_RuntimeError,
+ "%s ERROR: '%s' property exists with a bad type code '%d'!",
+ __func__, prop->name, prop->type);
return NULL;
}
@@ -601,7 +654,9 @@ static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value)
const char *name = _PyUnicode_AsString(value);
if (!name) {
- PyErr_SetString(PyExc_TypeError, "pop expected at least 1 argument, got 0");
+ PyErr_Format(PyExc_TypeError,
+ "pop expected at least a string argument, not %.200s",
+ Py_TYPE(value)->tp_name);
return NULL;
}
@@ -654,44 +709,44 @@ static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len,
PyObject *BPy_Wrap_GetKeys(IDProperty *prop)
{
- PyObject *seq = PyList_New(prop->len);
+ PyObject *list = PyList_New(prop->len);
IDProperty *loop;
int i;
for (i=0, loop=prop->data.group.first; loop && (i < prop->len); loop=loop->next, i++)
- PyList_SET_ITEM(seq, i, PyUnicode_FromString(loop->name));
+ PyList_SET_ITEM(list, i, PyUnicode_FromString(loop->name));
/* if the id prop is corrupt, count the remaining */
for (; loop; loop=loop->next, i++) {}
if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */
- BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
- Py_DECREF(seq); /*free the list*/
+ BPy_IDGroup_CorrectListLen(prop, list, i, __func__);
+ Py_DECREF(list); /*free the list*/
/*call self again*/
return BPy_Wrap_GetKeys(prop);
}
- return seq;
+ return list;
}
PyObject *BPy_Wrap_GetValues(ID *id, IDProperty *prop)
{
- PyObject *seq = PyList_New(prop->len);
+ PyObject *list = PyList_New(prop->len);
IDProperty *loop;
int i;
for (i=0, loop=prop->data.group.first; loop; loop=loop->next, i++) {
- PyList_SET_ITEM(seq, i, BPy_IDGroup_WrapData(id, loop));
+ PyList_SET_ITEM(list, i, BPy_IDGroup_WrapData(id, loop, prop));
}
if (i != prop->len) {
- BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
- Py_DECREF(seq); /*free the list*/
+ BPy_IDGroup_CorrectListLen(prop, list, i, __func__);
+ Py_DECREF(list); /*free the list*/
/*call self again*/
return BPy_Wrap_GetValues(id, prop);
}
- return seq;
+ return list;
}
PyObject *BPy_Wrap_GetItems(ID *id, IDProperty *prop)
@@ -703,7 +758,7 @@ PyObject *BPy_Wrap_GetItems(ID *id, IDProperty *prop)
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));
+ PyTuple_SET_ITEM(item, 1, BPy_IDGroup_WrapData(id, loop, prop));
PyList_SET_ITEM(seq, i, item);
}
@@ -738,7 +793,9 @@ static int BPy_IDGroup_Contains(BPy_IDProperty *self, PyObject *value)
const char *name = _PyUnicode_AsString(value);
if (!name) {
- PyErr_SetString(PyExc_TypeError, "expected a string");
+ PyErr_Format(PyExc_TypeError,
+ "expected a string, not a %.200s",
+ Py_TYPE(value)->tp_name);
return -1;
}
@@ -751,7 +808,9 @@ static PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *value)
Py_ssize_t i=0;
if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError, "expected an object derived from dict");
+ PyErr_Format(PyExc_TypeError,
+ "expected a dict not a %.200s",
+ Py_TYPE(value)->tp_name);
return NULL;
}
@@ -781,7 +840,7 @@ static PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
idprop= IDP_GetPropertyFromGroup(self->prop, key);
if (idprop) {
- PyObject* pyobj = BPy_IDGroup_WrapData(self->id, idprop);
+ PyObject* pyobj = BPy_IDGroup_WrapData(self->id, idprop, self->prop);
if (pyobj)
return pyobj;
}
@@ -890,18 +949,6 @@ PyTypeObject BPy_IDGroup_Type = {
BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */
};
-/*********** Main external wrapping function *******/
-PyObject *BPy_Wrap_IDProperty(ID *id, IDProperty *prop, IDProperty *parent)
-{
- BPy_IDProperty *wrap = PyObject_New(BPy_IDProperty, &BPy_IDGroup_Type);
- wrap->prop = prop;
- wrap->parent = parent;
- wrap->id = id;
- //wrap->destroy = 0;
- return (PyObject*) wrap;
-}
-
-
/********Array Wrapper********/
static PyTypeObject *idp_array_py_type(BPy_IDArray *self, short *is_double)
@@ -938,7 +985,10 @@ static PyObject *BPy_IDArray_GetType(BPy_IDArray *self)
return PyUnicode_FromString("i");
}
- PyErr_SetString(PyExc_RuntimeError, "invalid/corrupt array type!");
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: invalid/corrupt array type '%d'!",
+ __func__, self->prop->subtype);
+
return NULL;
}
@@ -980,7 +1030,10 @@ static PyObject *BPy_IDArray_GetItem(BPy_IDArray *self, int index)
return PyLong_FromLong((long)((int*)IDP_Array(self->prop))[index]);
}
- PyErr_SetString(PyExc_RuntimeError, "invalid/corrupt array type!");
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: invalid/corrupt array type '%d'!",
+ __func__, self->prop->subtype);
+
return NULL;
}
@@ -1143,7 +1196,9 @@ static PyObject *BPy_IDArray_subscript(BPy_IDArray* self, PyObject* item)
}
}
else {
- PyErr_Format(PyExc_TypeError, "vector indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+ PyErr_Format(PyExc_TypeError,
+ "vector indices must be integers, not %.200s",
+ __func__, Py_TYPE(item)->tp_name);
return NULL;
}
}
@@ -1172,7 +1227,9 @@ static int BPy_IDArray_ass_subscript(BPy_IDArray* self, PyObject* item, PyObject
}
}
else {
- PyErr_Format(PyExc_TypeError, "vector indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+ PyErr_Format(PyExc_TypeError,
+ "vector indices must be integers, not %.200s",
+ Py_TYPE(item)->tp_name);
return -1;
}
}
@@ -1289,7 +1346,7 @@ static PyObject *BPy_Group_Iter_Next(BPy_IDGroup_Iter *self)
if (self->mode == IDPROP_ITER_ITEMS) {
ret = PyTuple_New(2);
PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(cur->name));
- PyTuple_SET_ITEM(ret, 1, BPy_IDGroup_WrapData(self->group->id, cur));
+ PyTuple_SET_ITEM(ret, 1, BPy_IDGroup_WrapData(self->group->id, cur, self->group->prop));
return ret;
}
else {
diff --git a/source/blender/python/generic/IDProp.h b/source/blender/python/generic/idprop_py_api.h
index 36cb4c76a5c..599ba8e1db6 100644
--- a/source/blender/python/generic/IDProp.h
+++ b/source/blender/python/generic/idprop_py_api.h
@@ -20,13 +20,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/python/generic/IDProp.h
+/** \file blender/python/generic/idprop_py_api.h
* \ingroup pygen
*/
-#ifndef IDPROP_H
-#define IDPROP_H
+#ifndef PY_IDPROP_API_H
+#define PY_IDPROP_API_H
struct ID;
struct IDProperty;
@@ -53,14 +53,13 @@ typedef struct BPy_IDGroup_Iter {
int mode;
} BPy_IDGroup_Iter;
-PyObject *BPy_Wrap_IDProperty(struct ID *id, struct IDProperty *prop, struct IDProperty *parent);
PyObject *BPy_Wrap_GetKeys(struct IDProperty *prop);
PyObject *BPy_Wrap_GetValues(struct ID *id, struct IDProperty *prop);
PyObject *BPy_Wrap_GetItems(struct ID *id, struct IDProperty *prop);
int BPy_Wrap_SetMapItem(struct IDProperty *prop, PyObject *key, PyObject *val);
-PyObject *BPy_IDGroup_WrapData(struct ID *id, struct IDProperty *prop );
+PyObject *BPy_IDGroup_WrapData(struct ID *id, struct IDProperty *prop, struct IDProperty *parent);
const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *key, struct IDProperty *group, PyObject *ob);
void IDProp_Init_Types(void);
@@ -68,4 +67,4 @@ void IDProp_Init_Types(void);
#define IDPROP_ITER_KEYS 0
#define IDPROP_ITER_ITEMS 1
-#endif /* IDPROP_H */
+#endif /* PY_IDPROP_API_H */
diff --git a/source/blender/python/generic/noise_py_api.c b/source/blender/python/generic/noise_py_api.c
index c84aab83b7e..902e64eb7c1 100644
--- a/source/blender/python/generic/noise_py_api.c
+++ b/source/blender/python/generic/noise_py_api.c
@@ -291,7 +291,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
amp = 1.f;
out = (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
if (hard)
- out = (float)fabs(out);
+ out = fabsf(out);
for (i = 1; i < oct; i++) {
amp *= ampscale;
x *= freqscale;
@@ -299,7 +299,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
z *= freqscale;
t = (float)(amp * (2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f));
if (hard)
- t = (float)fabs(t);
+ t = fabsf(t);
out += t;
}
return out;
@@ -321,16 +321,16 @@ static PyObject *Noise_turbulence(PyObject *UNUSED(self), PyObject *args)
/* Turbulence Vector */
static void vTurb(float x, float y, float z, int oct, int hard, int nb,
- float ampscale, float freqscale, float v[3])
+ float ampscale, float freqscale, float v[3])
{
float amp, t[3];
int i;
amp = 1.f;
noise_vector(x, y, z, nb, v);
if (hard) {
- v[0] = (float)fabs(v[0]);
- v[1] = (float)fabs(v[1]);
- v[2] = (float)fabs(v[2]);
+ v[0] = fabsf(v[0]);
+ v[1] = fabsf(v[1]);
+ v[2] = fabsf(v[2]);
}
for (i = 1; i < oct; i++) {
amp *= ampscale;
@@ -339,9 +339,9 @@ static void vTurb(float x, float y, float z, int oct, int hard, int nb,
z *= freqscale;
noise_vector(x, y, z, nb, t);
if (hard) {
- t[0] = (float)fabs(t[0]);
- t[1] = (float)fabs(t[1]);
- t[2] = (float)fabs(t[2]);
+ t[0] = fabsf(t[0]);
+ t[1] = fabsf(t[1]);
+ t[2] = fabsf(t[2]);
}
v[0] += amp * t[0];
v[1] += amp * t[1];
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 8bd1fae23d0..d2d9c51643f 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -53,7 +53,7 @@
#include "MEM_guardedalloc.h"
/* external util modules */
-#include "../generic/IDProp.h"
+#include "../generic/idprop_py_api.h"
#include "../generic/bgl.h"
#include "../generic/blf_py_api.h"
#include "../mathutils/mathutils.h"
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index 12fb5ed43b4..2aad4d8f2fe 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -91,6 +91,29 @@ int bpy_pydriver_create_dict(void)
return 0;
}
+/* note, this function should do nothing most runs, only when changing frame */
+static PyObject *bpy_pydriver_InternStr__frame= NULL;
+
+static void bpy_pydriver_update_dict(const float evaltime)
+{
+ /* not thread safe but neither is python */
+ static float evaltime_prev= FLT_MAX;
+
+ if (evaltime_prev != evaltime) {
+
+ /* currently only update the frame */
+ if (bpy_pydriver_InternStr__frame == NULL) {
+ bpy_pydriver_InternStr__frame= PyUnicode_FromString("frame");
+ }
+
+ PyDict_SetItem(bpy_pydriver_Dict,
+ bpy_pydriver_InternStr__frame,
+ PyFloat_FromDouble(evaltime));
+
+ evaltime_prev= evaltime;
+ }
+}
+
/* Update function, it gets rid of pydrivers global dictionary, forcing
* BPY_driver_exec to recreate it. This function is used to force
* reloading the Blender text module "pydrivers.py", if available, so
@@ -110,6 +133,11 @@ void BPY_driver_reset(void)
bpy_pydriver_Dict= NULL;
}
+ if (bpy_pydriver_InternStr__frame) {
+ Py_DECREF(bpy_pydriver_InternStr__frame);
+ bpy_pydriver_InternStr__frame= NULL;
+ }
+
if (use_gil)
PyGILState_Release(gilstate);
@@ -139,7 +167,7 @@ static void pydriver_error(ChannelDriver *driver)
* now release the GIL on python operator execution instead, using
* PyEval_SaveThread() / PyEval_RestoreThread() so we dont lock up blender.
*/
-float BPY_driver_exec(ChannelDriver *driver)
+float BPY_driver_exec(ChannelDriver *driver, const float evaltime)
{
PyObject *driver_vars=NULL;
PyObject *retval= NULL;
@@ -183,6 +211,10 @@ float BPY_driver_exec(ChannelDriver *driver)
}
}
+ /* update global namespace */
+ bpy_pydriver_update_dict(evaltime);
+
+
if (driver->expr_comp==NULL)
driver->flag |= DRIVER_FLAG_RECOMPILE;
@@ -246,6 +278,7 @@ float BPY_driver_exec(ChannelDriver *driver)
}
}
+
#if 0 // slow, with this can avoid all Py_CompileString above.
/* execute expression to get a value */
retval= PyRun_String(expr, Py_eval_input, bpy_pydriver_Dict, driver_vars);
diff --git a/source/blender/python/intern/bpy_driver.h b/source/blender/python/intern/bpy_driver.h
index 3e38cacf6d1..802a3649e20 100644
--- a/source/blender/python/intern/bpy_driver.h
+++ b/source/blender/python/intern/bpy_driver.h
@@ -33,7 +33,7 @@ int bpy_pydriver_create_dict(void);
extern PyObject *bpy_pydriver_Dict;
/* externals */
-float BPY_driver_exec(struct ChannelDriver *driver);
+float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime);
void BPY_driver_reset(void);
#endif // BPY_DRIVER_H
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 4dbaf5db4a4..950aa9458d5 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -74,6 +74,7 @@ static EnumPropertyItem property_subtype_string_items[]= {
{PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""},
{PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""},
{PROP_FILENAME, "FILENAME", 0, "Filename", ""},
+ {PROP_BYTESTRING, "BYTE_STRING", 0, "Byte String", ""},
{PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
{PROP_NONE, "NONE", 0, "None", ""},
@@ -425,6 +426,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -503,6 +505,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -568,6 +571,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -648,6 +652,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -723,6 +728,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -811,6 +817,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -873,6 +880,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -1204,6 +1212,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -1301,6 +1310,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
bpy_prop_callback_assign(prop, update_cb);
RNA_def_property_duplicate_pointers(srna, prop);
@@ -1355,6 +1365,7 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
if (pyopts) {
if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
RNA_def_property_duplicate_pointers(srna, prop);
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 15a9ba44552..3bde38d1445 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -64,6 +64,7 @@
#include "MEM_guardedalloc.h"
+#include "BKE_main.h"
#include "BKE_idcode.h"
#include "BKE_context.h"
#include "BKE_global.h" /* evil G.* */
@@ -73,7 +74,7 @@
#include "BKE_animsys.h"
#include "BKE_fcurve.h"
-#include "../generic/IDProp.h" /* for IDprop lookups */
+#include "../generic/idprop_py_api.h" /* for IDprop lookups */
#include "../generic/py_capi_utils.h"
#ifdef WITH_INTERNATIONAL
@@ -598,7 +599,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
int subtype, totdim;
int len;
int is_thick;
- int flag= RNA_property_flag(prop);
+ const int flag= RNA_property_flag(prop);
/* disallow dynamic sized arrays to be wrapped since the size could change
* to a size mathutils does not support */
@@ -614,7 +615,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
if (!is_thick)
ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
- switch(RNA_property_subtype(prop)) {
+ switch(subtype) {
case PROP_ALL_VECTOR_SUBTYPES:
if (len>=2 && len <= 4) {
if (is_thick) {
@@ -902,7 +903,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
}
/* if a pointer, try to print name of pointer target too */
- if (RNA_property_type(self->prop) == PROP_POINTER) {
+ if (type == PROP_POINTER) {
ptr= RNA_property_pointer_get(&self->ptr, self->prop);
name= RNA_struct_name_get_alloc(&ptr, NULL, 0, NULL);
@@ -916,7 +917,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
return ret;
}
}
- if (RNA_property_type(self->prop) == PROP_COLLECTION) {
+ if (type == PROP_COLLECTION) {
PointerRNA r_ptr;
if (RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
return PyUnicode_FromFormat("<bpy_%.200s, %.200s>",
@@ -1301,7 +1302,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
{
PyObject *ret;
- int type= RNA_property_type(prop);
+ const int type= RNA_property_type(prop);
if (RNA_property_array_check(prop)) {
return pyrna_py_from_array(ptr, prop);
@@ -1320,7 +1321,7 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
break;
case PROP_STRING:
{
- int subtype= RNA_property_subtype(prop);
+ const int subtype= RNA_property_subtype(prop);
const char *buf;
int buf_len;
char buf_fixed[32];
@@ -1328,14 +1329,22 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
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 (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+ 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
- 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);
@@ -1450,7 +1459,7 @@ static PyObject *pyrna_func_to_py(PointerRNA *ptr, FunctionRNA *func)
static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix)
{
/* XXX hard limits should be checked here */
- int type= RNA_property_type(prop);
+ const int type= RNA_property_type(prop);
if (RNA_property_array_check(prop)) {
@@ -1534,53 +1543,91 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
}
case PROP_STRING:
{
+ const int subtype= RNA_property_subtype(prop);
const char *param;
-#ifdef USE_STRING_COERCE
- PyObject *value_coerce= NULL;
- int subtype= RNA_property_subtype(prop);
- if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
- /* TODO, get size */
- param= PyC_UnicodeAsByte(value, &value_coerce);
+
+ if (subtype == PROP_BYTESTRING) {
+
+ /* Byte String */
+
+ 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);
+ }
+
+ 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 {
- param= _PyUnicode_AsString(value);
-#ifdef WITH_INTERNATIONAL
- if (subtype == PROP_TRANSLATE) {
- param= IFACE_(param);
+
+ /* 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);
+ }
#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 {
- 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;
}
case PROP_ENUM:
@@ -2050,6 +2097,84 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons
}
/* static PyObject *pyrna_prop_array_subscript_str(BPy_PropertyRNA *self, char *keyname) */
+/* special case: bpy.data.objects["some_id_name", "//some_lib_name.blend"]
+ * also for: bpy.data.objects.get(("some_id_name", "//some_lib_name.blend"), fallback) */
+static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const short err_not_found)
+{
+ char *keyname;
+
+ /* first validate the args, all we know is that they are a tuple */
+ if (PyTuple_GET_SIZE(key) != 2) {
+ PyErr_Format(PyExc_KeyError,
+ "%s: tuple key must be a pair, not size %d",
+ err_prefix, PyTuple_GET_SIZE(key));
+ return NULL;
+ }
+ else if (self->ptr.type != &RNA_BlendData) {
+ PyErr_Format(PyExc_KeyError,
+ "%s: is only valid for bpy.data collections, not %.200s",
+ err_prefix, RNA_struct_identifier(self->ptr.type));
+ return NULL;
+ }
+ else if ((keyname= _PyUnicode_AsString(PyTuple_GET_ITEM(key, 0))) == NULL) {
+ PyErr_Format(PyExc_KeyError,
+ "%s: id must be a string, not %.200s",
+ err_prefix, Py_TYPE(PyTuple_GET_ITEM(key, 0))->tp_name);
+ return NULL;
+ }
+ else {
+ PyObject *keylib= PyTuple_GET_ITEM(key, 1);
+ Library *lib;
+ PyObject *ret= NULL;
+
+ if (keylib == Py_None) {
+ lib= NULL;
+ }
+ else if (PyUnicode_Check(keylib)) {
+ Main *bmain= self->ptr.data;
+ const char *keylib_str= _PyUnicode_AsString(keylib);
+ lib= BLI_findstring(&bmain->library, keylib_str, offsetof(Library, name));
+ 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);
+ }
+
+ return NULL;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_KeyError,
+ "%s: lib must be a sting or None, not %.200s",
+ err_prefix, Py_TYPE(keylib)->tp_name);
+ return NULL;
+ }
+
+ /* lib is either a valid poniter or NULL,
+ * either way can do direct comparison with id.lib */
+
+ RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) {
+ ID *id= itemptr.data; /* always an ID */
+ if (id->lib == lib && (strncmp(keyname, id->name+2, sizeof(id->name)-2) == 0)) {
+ ret= pyrna_struct_CreatePyObject(&itemptr);
+ break;
+ }
+ }
+ RNA_PROP_END;
+
+ /* we may want to fail silently as with collection.get() */
+ if ((ret == NULL) && err_not_found) {
+ /* only runs for getitem access so use fixed string */
+ PyErr_SetString(PyExc_KeyError,
+ "bpy_prop_collection[key, lib]: not found");
+ }
+
+ return ret;
+ }
+}
+
static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop)
{
CollectionPropertyIterator rna_macro_iter;
@@ -2220,6 +2345,10 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
}
}
}
+ else if (PyTuple_Check(key)) {
+ /* special case, for ID datablocks we */
+ return pyrna_prop_collection_subscript_str_lib_pair(self, key, "bpy_prop_collection[id, lib]", TRUE);
+ }
else {
PyErr_Format(PyExc_TypeError,
"bpy_prop_collection[key]: invalid key, "
@@ -2736,7 +2865,7 @@ static PyObject *pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key)
return NULL;
}
- return BPy_IDGroup_WrapData(self->ptr.id.data, idprop);
+ return BPy_IDGroup_WrapData(self->ptr.id.data, idprop, group);
}
static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObject *value)
@@ -2751,7 +2880,7 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje
if (rna_disallow_writes && rna_id_write_error(&self->ptr, key)) {
return -1;
}
-#endif // USE_STRING_COERCE
+#endif // USE_PEDANTIC_WRITE
if (group==NULL) {
PyErr_SetString(PyExc_TypeError, "bpy_struct[key]= val: id properties not supported for this type");
@@ -3440,7 +3569,7 @@ static int pyrna_struct_setattro(BPy_StructRNA *self, PyObject *pyname, PyObject
if (rna_disallow_writes && rna_id_write_error(&self->ptr, pyname)) {
return -1;
}
-#endif // USE_STRING_COERCE
+#endif // USE_PEDANTIC_WRITE
if (name == NULL) {
PyErr_SetString(PyExc_AttributeError, "bpy_struct: __setattr__ must be a string");
@@ -3600,7 +3729,7 @@ static int pyrna_prop_collection_setattro(BPy_PropertyRNA *self, PyObject *pynam
if (rna_disallow_writes && rna_id_write_error(&self->ptr, pyname)) {
return -1;
}
-#endif // USE_STRING_COERCE
+#endif // USE_PEDANTIC_WRITE
if (name == NULL) {
PyErr_SetString(PyExc_AttributeError, "bpy_prop: __setattr__ must be a string");
@@ -3846,7 +3975,7 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
idprop= IDP_GetPropertyFromGroup(group, key);
if (idprop) {
- return BPy_IDGroup_WrapData(self->ptr.id.data, idprop);
+ return BPy_IDGroup_WrapData(self->ptr.id.data, idprop, group);
}
}
@@ -3869,6 +3998,7 @@ static PyObject *pyrna_struct_as_pointer(BPy_StructRNA *self)
return PyLong_FromVoidPtr(self->ptr.data);
}
+/* TODO, get (string, lib) pair */
PyDoc_STRVAR(pyrna_prop_collection_get_doc,
".. method:: get(key, default=None)\n"
"\n"
@@ -3885,16 +4015,31 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args
{
PointerRNA newptr;
- const char *key;
+ PyObject *key_ob;
PyObject* def= Py_None;
PYRNA_PROP_CHECK_OBJ(self);
- if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
+ if (!PyArg_ParseTuple(args, "O|O:get", &key_ob, &def))
return NULL;
- if (RNA_property_collection_lookup_string(&self->ptr, self->prop, key, &newptr))
- return pyrna_struct_CreatePyObject(&newptr);
+ if (PyUnicode_Check(key_ob)) {
+ const char *key= _PyUnicode_AsString(key_ob);
+
+ if (RNA_property_collection_lookup_string(&self->ptr, self->prop, key, &newptr))
+ return pyrna_struct_CreatePyObject(&newptr);
+ }
+ else if (PyTuple_Check(key_ob)) {
+ PyObject *ret= pyrna_prop_collection_subscript_str_lib_pair(self, key_ob, "bpy_prop_collection.get((id, lib))", FALSE);
+ if (ret) {
+ return ret;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_KeyError,
+ "bpy_prop_collection.get(key, ...): key must be a string or tuple, not %.200s",
+ Py_TYPE(key_ob)->tp_name);
+ }
return Py_INCREF(def), def;
}
@@ -4365,8 +4510,8 @@ static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UN
static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PyObject *ret;
- int type= RNA_property_type(prop);
- int flag= RNA_property_flag(prop);
+ const int type= RNA_property_type(prop);
+ const int flag= RNA_property_flag(prop);
if (RNA_property_array_check(prop)) {
int a, len;
@@ -4442,7 +4587,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
{
char *data_ch;
PyObject *value_coerce= NULL;
- int subtype= RNA_property_subtype(prop);
+ const int subtype= RNA_property_subtype(prop);
if (flag & PROP_THICK_WRAP)
data_ch= (char *)data;
@@ -4450,14 +4595,22 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
data_ch= *(char **)data;
#ifdef USE_STRING_COERCE
- if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+ 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
- ret= PyUnicode_FromString(data_ch);
+ if (subtype == PROP_BYTESTRING) {
+ ret= PyBytes_FromString(buf);
+ }
+ else {
+ ret= PyUnicode_FromString(data_ch);
+ }
#endif
#ifdef USE_STRING_COERCE
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index c374d0eb73d..79628cf5ae9 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -370,9 +370,10 @@ static PyObject *Color_add(PyObject *v1, PyObject *v2)
float col[COLOR_SIZE];
if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
- PyErr_SetString(PyExc_TypeError,
- "Color addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color addition: (%s + %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
color1 = (ColorObject*)v1;
@@ -392,9 +393,10 @@ static PyObject *Color_iadd(PyObject *v1, PyObject *v2)
ColorObject *color1 = NULL, *color2 = NULL;
if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
- PyErr_SetString(PyExc_TypeError,
- "Color addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color addition: (%s += %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
color1 = (ColorObject*)v1;
@@ -417,9 +419,10 @@ static PyObject *Color_sub(PyObject *v1, PyObject *v2)
float col[COLOR_SIZE];
if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
- PyErr_SetString(PyExc_TypeError,
- "Color subtraction: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color subtraction: (%s - %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
color1 = (ColorObject*)v1;
@@ -439,9 +442,10 @@ static PyObject *Color_isub(PyObject *v1, PyObject *v2)
ColorObject *color1= NULL, *color2= NULL;
if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
- PyErr_SetString(PyExc_TypeError,
- "Color subtraction: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color subtraction: (%s -= %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
color1 = (ColorObject*)v1;
@@ -554,9 +558,10 @@ static PyObject *Color_imul(PyObject *v1, PyObject *v2)
mul_vn_fl(color->col, COLOR_SIZE, scalar);
}
else {
- PyErr_SetString(PyExc_TypeError,
- "Color multiplication: "
- "arguments not acceptable for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color multiplication: (%s *= %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
@@ -585,9 +590,10 @@ static PyObject *Color_idiv(PyObject *v1, PyObject *v2)
mul_vn_fl(color->col, COLOR_SIZE, 1.0f / scalar);
}
else {
- PyErr_SetString(PyExc_TypeError,
- "Color multiplication: "
- "arguments not acceptable for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Color division: (%s /= %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
@@ -828,18 +834,18 @@ PyObject *newColorObject(float *col, int type, PyTypeObject *base_type)
self= base_type ? (ColorObject *)base_type->tp_alloc(base_type, 0) :
(ColorObject *)PyObject_GC_New(ColorObject, &color_Type);
- if(self) {
+ if (self) {
/* init callbacks as NULL */
self->cb_user= NULL;
self->cb_type= self->cb_subtype= 0;
- if(type == Py_WRAP) {
+ if (type == Py_WRAP) {
self->col = col;
self->wrapped = Py_WRAP;
}
else if (type == Py_NEW) {
self->col = PyMem_Malloc(COLOR_SIZE * sizeof(float));
- if(col)
+ if (col)
copy_v3_v3(self->col, col);
else
zero_v3(self->col);
@@ -857,7 +863,7 @@ PyObject *newColorObject(float *col, int type, PyTypeObject *base_type)
PyObject *newColorObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
{
ColorObject *self= (ColorObject *)newColorObject(NULL, Py_NEW, NULL);
- if(self) {
+ if (self) {
Py_INCREF(cb_user);
self->cb_user= cb_user;
self->cb_type= (unsigned char)cb_type;
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 980dbd17a96..1472b6886f6 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -941,8 +941,10 @@ static PyObject *Matrix_invert(MatrixObject *self)
int x, y, z = 0;
float det = 0.0f;
- 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};
+ 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};
if (BaseMath_ReadCallback(self) == -1)
return NULL;
@@ -964,9 +966,11 @@ static PyObject *Matrix_invert(MatrixObject *self)
mat[1] = -self->matrix[0][1];
mat[2] = -self->matrix[1][0];
mat[3] = self->matrix[0][0];
- } else if (self->row_size == 3) {
+ }
+ else if (self->row_size == 3) {
adjoint_m3_m3((float (*)[3]) mat,(float (*)[3])self->contigPtr);
- } else if (self->row_size == 4) {
+ }
+ else if (self->row_size == 4) {
adjoint_m4_m4((float (*)[4]) mat, (float (*)[4])self->contigPtr);
}
/*divide by determinate*/
@@ -1183,7 +1187,8 @@ static PyObject *Matrix_transpose(MatrixObject *self)
t = self->matrix[1][0];
self->matrix[1][0] = self->matrix[0][1];
self->matrix[0][1] = t;
- } else if (self->row_size == 3) {
+ }
+ else if (self->row_size == 3) {
transpose_m3((float (*)[3])self->contigPtr);
}
else {
@@ -1253,7 +1258,8 @@ static PyObject *Matrix_identity(MatrixObject *self)
self->matrix[0][1] = 0.0f;
self->matrix[1][0] = 0.0f;
self->matrix[1][1] = 1.0f;
- } else if (self->row_size == 3) {
+ }
+ else if (self->row_size == 3) {
unit_m3((float (*)[3])self->contigPtr);
}
else {
@@ -1489,9 +1495,10 @@ static PyObject *Matrix_add(PyObject *m1, PyObject *m2)
mat2 = (MatrixObject*)m2;
if (!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) {
- PyErr_SetString(PyExc_TypeError,
- "Matrix addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Matrix addition: (%s + %s) "
+ "invalid type for this operation",
+ Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}
@@ -1520,9 +1527,11 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
mat2 = (MatrixObject*)m2;
if (!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) {
- PyErr_SetString(PyExc_TypeError,
- "Matrix addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Matrix subtraction: (%s - %s) "
+ "invalid type for this operation",
+ Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name
+ );
return NULL;
}
@@ -1654,7 +1663,8 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
if (i < 0)
i += self->row_size;
return Matrix_item(self, i);
- } else if (PySlice_Check(item)) {
+ }
+ else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((void *)item, self->row_size, &start, &stop, &step, &slicelength) < 0)
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index 51ab5b50919..8a6c4909e94 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -639,7 +639,8 @@ static PyObject *Quaternion_subscript(QuaternionObject *self, PyObject *item)
if (i < 0)
i += QUAT_SIZE;
return Quaternion_item(self, i);
- } else if (PySlice_Check(item)) {
+ }
+ else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((void *)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)
@@ -707,9 +708,10 @@ static PyObject *Quaternion_add(PyObject *q1, PyObject *q2)
QuaternionObject *quat1 = NULL, *quat2 = NULL;
if (!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) {
- PyErr_SetString(PyExc_TypeError,
- "Quaternion addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Quaternion addition: (%s + %s) "
+ "invalid type for this operation",
+ Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}
quat1 = (QuaternionObject*)q1;
@@ -730,9 +732,10 @@ static PyObject *Quaternion_sub(PyObject *q1, PyObject *q2)
QuaternionObject *quat1 = NULL, *quat2 = NULL;
if (!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) {
- PyErr_SetString(PyExc_TypeError,
- "Quaternion addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Quaternion subtraction: (%s - %s) "
+ "invalid type for this operation",
+ Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index ba7cf604c42..f70bd42e2b6 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -61,7 +61,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED
case 0:
break;
case 1:
- if((size=mathutils_array_parse(vec, 2, 4, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1)
+ if ((size=mathutils_array_parse(vec, 2, 4, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1)
return NULL;
break;
default:
@@ -77,7 +77,7 @@ static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *sel
{
PyObject *ret= Vector_copy(self);
PyObject *ret_dummy= vec_func(ret);
- if(ret_dummy) {
+ if (ret_dummy) {
Py_DECREF(ret_dummy);
return (PyObject *)ret;
}
@@ -97,7 +97,7 @@ static PyObject *Vector_zero(VectorObject *self)
{
fill_vn(self->vec, self->size, 0.0f);
- if(BaseMath_WriteCallback(self) == -1)
+ if (BaseMath_WriteCallback(self) == -1)
return NULL;
Py_RETURN_NONE;
@@ -119,7 +119,7 @@ static PyObject *Vector_normalize(VectorObject *self)
int i;
float norm = 0.0f;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
for (i = 0; i < self->size; i++) {
@@ -156,13 +156,13 @@ PyDoc_STRVAR(Vector_resize_2d_doc,
);
static PyObject *Vector_resize_2d(VectorObject *self)
{
- if(self->wrapped==Py_WRAP) {
+ if (self->wrapped==Py_WRAP) {
PyErr_SetString(PyExc_TypeError,
"Vector.resize_2d(): "
"cannot resize wrapped data - only python vectors");
return NULL;
}
- if(self->cb_user) {
+ if (self->cb_user) {
PyErr_SetString(PyExc_TypeError,
"Vector.resize_2d(): "
"cannot resize a vector that has an owner");
@@ -170,7 +170,7 @@ static PyObject *Vector_resize_2d(VectorObject *self)
}
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
- if(self->vec == NULL) {
+ if (self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
"Vector.resize_2d(): "
"problem allocating pointer space");
@@ -197,7 +197,7 @@ static PyObject *Vector_resize_3d(VectorObject *self)
"cannot resize wrapped data - only python vectors");
return NULL;
}
- if(self->cb_user) {
+ if (self->cb_user) {
PyErr_SetString(PyExc_TypeError,
"Vector.resize_3d(): "
"cannot resize a vector that has an owner");
@@ -205,14 +205,14 @@ static PyObject *Vector_resize_3d(VectorObject *self)
}
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
- if(self->vec == NULL) {
+ if (self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
"Vector.resize_3d(): "
"problem allocating pointer space");
return NULL;
}
- if(self->size == 2)
+ if (self->size == 2)
self->vec[2] = 0.0f;
self->size = 3;
@@ -229,13 +229,13 @@ PyDoc_STRVAR(Vector_resize_4d_doc,
);
static PyObject *Vector_resize_4d(VectorObject *self)
{
- if(self->wrapped==Py_WRAP) {
+ if (self->wrapped==Py_WRAP) {
PyErr_SetString(PyExc_TypeError,
"Vector.resize_4d(): "
"cannot resize wrapped data - only python vectors");
return NULL;
}
- if(self->cb_user) {
+ if (self->cb_user) {
PyErr_SetString(PyExc_TypeError,
"Vector.resize_4d(): "
"cannot resize a vector that has an owner");
@@ -243,18 +243,18 @@ static PyObject *Vector_resize_4d(VectorObject *self)
}
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
- if(self->vec == NULL) {
+ if (self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
"Vector.resize_4d(): "
"problem allocating pointer space");
return NULL;
}
- if(self->size == 2) {
+ if (self->size == 2) {
self->vec[2] = 0.0f;
self->vec[3] = 1.0f;
}
- else if(self->size == 3) {
+ else if (self->size == 3) {
self->vec[3] = 1.0f;
}
self->size = 4;
@@ -270,7 +270,7 @@ PyDoc_STRVAR(Vector_to_2d_doc,
);
static PyObject *Vector_to_2d(VectorObject *self)
{
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
return newVectorObject(self->vec, 2, Py_NEW, Py_TYPE(self));
@@ -287,7 +287,7 @@ static PyObject *Vector_to_3d(VectorObject *self)
{
float tvec[3]= {0.0f};
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
@@ -305,7 +305,7 @@ static PyObject *Vector_to_4d(VectorObject *self)
{
float tvec[4]= {0.0f, 0.0f, 0.0f, 1.0f};
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 4));
@@ -330,7 +330,7 @@ static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
ret= PyTuple_New(self->size);
- if(ndigits >= 0) {
+ if (ndigits >= 0) {
for (i = 0; i < self->size; i++) {
PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(double_round((double)self->vec[i], ndigits)));
}
@@ -348,20 +348,20 @@ static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
{
int ndigits= 0;
- if(!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
+ if (!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
return NULL;
- if(ndigits > 22 || ndigits < 0) {
+ if (ndigits > 22 || ndigits < 0) {
PyErr_SetString(PyExc_ValueError,
"Vector.to_tuple(ndigits): "
"ndigits must be between 0 and 21");
return NULL;
}
- if(PyTuple_GET_SIZE(args)==0)
+ if (PyTuple_GET_SIZE(args)==0)
ndigits= -1;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
return Vector_to_tuple_ext(self, ndigits);
@@ -385,7 +385,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
const char *strack, *sup;
short track = 2, up = 1;
- if(!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
+ if (!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
return NULL;
if (self->size != 3) {
@@ -395,7 +395,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
return NULL;
}
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
if (strack) {
@@ -508,10 +508,10 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
float reflect[3] = {0.0f};
float tvec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
+ if ((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
return NULL;
mirror[0] = tvec[0];
@@ -547,10 +547,10 @@ static PyObject *Vector_cross(VectorObject *self, PyObject *value)
VectorObject *ret;
float tvec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
return NULL;
ret= (VectorObject *)newVectorObject(NULL, 3, Py_NEW, Py_TYPE(self));
@@ -574,10 +574,10 @@ static PyObject *Vector_dot(VectorObject *self, PyObject *value)
double dot = 0.0;
int x;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1)
return NULL;
for (x = 0; x < self->size; x++) {
@@ -611,13 +611,13 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
int x;
PyObject *fallback= NULL;
- if(!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
+ if (!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
return NULL;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1)
return NULL;
for (x = 0; x < size; x++) {
@@ -626,7 +626,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
}
if (!test_v1 || !test_v2) {
/* avoid exception */
- if(fallback) {
+ if (fallback) {
Py_INCREF(fallback);
return fallback;
}
@@ -648,7 +648,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
}
PyDoc_STRVAR(Vector_rotation_difference_doc,
-".. function:: difference(other)\n"
+".. function:: rotation_difference(other)\n"
"\n"
" Returns a quaternion representing the rotational difference between this\n"
" vector and another.\n"
@@ -664,17 +664,17 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
{
float quat[4], vec_a[3], vec_b[3];
- if(self->size < 3) {
+ if (self->size < 3) {
PyErr_SetString(PyExc_ValueError,
"vec.difference(value): "
"expects both vectors to be size 3 or 4");
return NULL;
}
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
return NULL;
normalize_v3_v3(vec_a, self->vec);
@@ -703,13 +703,13 @@ static PyObject *Vector_project(VectorObject *self, PyObject *value)
double dot = 0.0f, dot2 = 0.0f;
int x;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
return NULL;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
//get dot products
@@ -745,13 +745,13 @@ static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
float tvec[MAX_DIMENSIONS], vec[MAX_DIMENSIONS];
int x;
- if(!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
+ if (!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "Vector.lerp(other), invalid 'other' arg") == -1)
+ if (mathutils_array_parse(tvec, size, size, value, "Vector.lerp(other), invalid 'other' arg") == -1)
return NULL;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
ifac= 1.0f - fac;
@@ -774,13 +774,13 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
{
float other_rmat[3][3];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
+ if (mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
return NULL;
- if(self->size < 3) {
+ if (self->size < 3) {
PyErr_SetString(PyExc_ValueError,
"Vector must be 3D or 4D");
return NULL;
@@ -805,7 +805,7 @@ PyDoc_STRVAR(Vector_copy_doc,
);
static PyObject *Vector_copy(VectorObject *self)
{
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
return newVectorObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
@@ -815,7 +815,7 @@ static PyObject *Vector_repr(VectorObject *self)
{
PyObject *ret, *tuple;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
tuple= Vector_to_tuple_ext(self, -1);
@@ -833,10 +833,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 (i < 0 || i >= self->size) {
+ if (is_attr) {
PyErr_Format(PyExc_AttributeError,
"Vector.%c: unavailable on %dd vector",
*(((char *)"xyzw") + i), self->size);
@@ -848,7 +848,7 @@ static PyObject *vector_item_internal(VectorObject *self, int i, const int is_at
return NULL;
}
- if(BaseMath_ReadIndexCallback(self, i) == -1)
+ if (BaseMath_ReadIndexCallback(self, i) == -1)
return NULL;
return PyFloat_FromDouble(self->vec[i]);
@@ -862,17 +862,17 @@ static PyObject *Vector_item(VectorObject *self, int i)
static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr)
{
float scalar;
- if((scalar=PyFloat_AsDouble(value))==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
+ if ((scalar=PyFloat_AsDouble(value))==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
PyErr_SetString(PyExc_TypeError,
"vector[index] = x: "
"index argument not a number");
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) {
+ if (i < 0 || i >= self->size) {
+ if (is_attr) {
PyErr_Format(PyExc_AttributeError,
"Vector.%c = x: unavailable on %dd vector",
*(((char *)"xyzw") + i), self->size);
@@ -886,7 +886,7 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value,
}
self->vec[i] = scalar;
- if(BaseMath_WriteIndexCallback(self, i) == -1)
+ if (BaseMath_WriteIndexCallback(self, i) == -1)
return -1;
return 0;
}
@@ -902,7 +902,7 @@ static PyObject *Vector_slice(VectorObject *self, int begin, int end)
PyObject *tuple;
int count;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
CLAMP(begin, 0, self->size);
@@ -923,7 +923,7 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *se
int y, size = 0;
float vec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return -1;
CLAMP(begin, 0, self->size);
@@ -931,7 +931,7 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *se
begin = MIN2(begin, end);
size = (end - begin);
- if(mathutils_array_parse(vec, size, size, seq, "vector[begin:end] = [...]") == -1)
+ if (mathutils_array_parse(vec, size, size, seq, "vector[begin:end] = [...]") == -1)
return -1;
/*parsed well - now set in vector*/
@@ -939,7 +939,7 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *se
self->vec[begin + y] = vec[y];
}
- if(BaseMath_WriteCallback(self) == -1)
+ if (BaseMath_WriteCallback(self) == -1)
return -1;
return 0;
@@ -953,19 +953,20 @@ static PyObject *Vector_add(PyObject *v1, PyObject *v2)
float vec[MAX_DIMENSIONS];
if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
- PyErr_SetString(PyExc_AttributeError,
- "Vector addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_AttributeError,
+ "Vector addition: (%s + %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
vec1 = (VectorObject*)v1;
vec2 = (VectorObject*)v2;
- if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
/*VECTOR + VECTOR*/
- if(vec1->size != vec2->size) {
+ if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
"Vector addition: "
"vectors must have the same dimensions for this operation");
@@ -983,22 +984,23 @@ static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
VectorObject *vec1 = NULL, *vec2 = NULL;
if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
- PyErr_SetString(PyExc_AttributeError,
- "Vector addition: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_AttributeError,
+ "Vector addition: (%s += %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
vec1 = (VectorObject*)v1;
vec2 = (VectorObject*)v2;
- if(vec1->size != vec2->size) {
+ if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
"Vector addition: "
"vectors must have the same dimensions for this operation");
return NULL;
}
- if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
add_vn_vn(vec1->vec, vec2->vec, vec1->size);
@@ -1015,18 +1017,19 @@ static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
float vec[MAX_DIMENSIONS];
if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
- PyErr_SetString(PyExc_AttributeError,
- "Vector subtraction: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_AttributeError,
+ "Vector subtraction: (%s - %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
vec1 = (VectorObject*)v1;
vec2 = (VectorObject*)v2;
- if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
- if(vec1->size != vec2->size) {
+ if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
"Vector subtraction: "
"vectors must have the same dimensions for this operation");
@@ -1044,22 +1047,23 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
VectorObject *vec1= NULL, *vec2= NULL;
if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
- PyErr_SetString(PyExc_AttributeError,
- "Vector subtraction: "
- "arguments not valid for this operation");
+ PyErr_Format(PyExc_AttributeError,
+ "Vector subtraction: (%s -= %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
vec1 = (VectorObject*)v1;
vec2 = (VectorObject*)v2;
- if(vec1->size != vec2->size) {
+ if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
"Vector subtraction: "
"vectors must have the same dimensions for this operation");
return NULL;
}
- if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
sub_vn_vn(vec1->vec, vec2->vec, vec1->size);
@@ -1087,8 +1091,8 @@ int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec,
double dot = 0.0f;
int x, y, z = 0;
- if(mat->row_size != vec->size) {
- if(mat->row_size == 4 && vec->size == 3) {
+ if (mat->row_size != vec->size) {
+ if (mat->row_size == 4 && vec->size == 3) {
vec_cpy[3] = 1.0f;
}
else {
@@ -1129,12 +1133,12 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
if VectorObject_Check(v1) {
vec1= (VectorObject *)v1;
- if(BaseMath_ReadCallback(vec1) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1)
return NULL;
}
if VectorObject_Check(v2) {
vec2= (VectorObject *)v2;
- if(BaseMath_ReadCallback(vec2) == -1)
+ if (BaseMath_ReadCallback(vec2) == -1)
return NULL;
}
@@ -1144,7 +1148,7 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
int i;
double dot = 0.0f;
- if(vec1->size != vec2->size) {
+ if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"vectors must have the same dimensions for this operation");
@@ -1162,9 +1166,9 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
/* VEC * MATRIX */
float tvec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
+ 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;
}
@@ -1182,13 +1186,13 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
QuaternionObject *quat2 = (QuaternionObject*)v2;
float tvec[3];
- if(vec1->size != 3) {
+ if (vec1->size != 3) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"only 3D vector rotations (with quats) currently supported");
return NULL;
}
- if(BaseMath_ReadCallback(quat2) == -1) {
+ if (BaseMath_ReadCallback(quat2) == -1) {
return NULL;
}
@@ -1224,7 +1228,7 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
VectorObject *vec = (VectorObject *)v1;
float scalar;
- if(BaseMath_ReadCallback(vec) == -1)
+ if (BaseMath_ReadCallback(vec) == -1)
return NULL;
/* only support vec*=float and vec*=mat
@@ -1239,10 +1243,10 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
return NULL;
#else
float rvec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
+ 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);
@@ -1262,14 +1266,14 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
#else
QuaternionObject *quat2 = (QuaternionObject*)v2;
- if(vec->size != 3) {
+ if (vec->size != 3) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"only 3D vector rotations (with quats) currently supported");
return NULL;
}
- if(BaseMath_ReadCallback(quat2) == -1) {
+ if (BaseMath_ReadCallback(quat2) == -1) {
return NULL;
}
@@ -1281,9 +1285,10 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
mul_vn_fl(vec->vec, vec->size, scalar);
}
else {
- PyErr_SetString(PyExc_TypeError,
- "Vector multiplication: "
- "arguments not acceptable for this operation");
+ PyErr_Format(PyExc_TypeError,
+ "Vector multiplication: (%s *= %s) "
+ "invalid type for this operation",
+ Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
@@ -1299,7 +1304,7 @@ static PyObject *Vector_div(PyObject *v1, PyObject *v2)
float vec[4], scalar;
VectorObject *vec1 = NULL;
- if(!VectorObject_Check(v1)) { /* not a vector */
+ if (!VectorObject_Check(v1)) { /* not a vector */
PyErr_SetString(PyExc_TypeError,
"Vector division: "
"Vector must be divided by a float");
@@ -1307,17 +1312,17 @@ static PyObject *Vector_div(PyObject *v1, PyObject *v2)
}
vec1 = (VectorObject*)v1; /* vector */
- if(BaseMath_ReadCallback(vec1) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1)
return NULL;
- if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
+ if ((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
PyErr_SetString(PyExc_TypeError,
"Vector division: "
"Vector must be divided by a float");
return NULL;
}
- if(scalar==0.0f) {
+ if (scalar==0.0f) {
PyErr_SetString(PyExc_ZeroDivisionError,
"Vector division: "
"divide by zero error");
@@ -1337,17 +1342,17 @@ static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
float scalar;
VectorObject *vec1 = (VectorObject*)v1;
- if(BaseMath_ReadCallback(vec1) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1)
return NULL;
- if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
+ if ((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
PyErr_SetString(PyExc_TypeError,
"Vector division: "
"Vector must be divided by a float");
return NULL;
}
- if(scalar==0.0f) {
+ if (scalar==0.0f) {
PyErr_SetString(PyExc_ZeroDivisionError,
"Vector division: "
"divide by zero error");
@@ -1369,7 +1374,7 @@ static PyObject *Vector_neg(VectorObject *self)
{
float tvec[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
negate_vn_vn(tvec, self->vec, self->size);
@@ -1413,7 +1418,7 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
vecA = (VectorObject*)objectA;
vecB = (VectorObject*)objectB;
- if(BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
+ if (BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
return NULL;
if (vecA->size != vecB->size) {
@@ -1429,14 +1434,14 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
case Py_LT:
lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- if(lenA < lenB) {
+ if (lenA < lenB) {
result = 1;
}
break;
case Py_LE:
lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- if(lenA < lenB) {
+ if (lenA < lenB) {
result = 1;
}
else {
@@ -1452,14 +1457,14 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
case Py_GT:
lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- if(lenA > lenB) {
+ if (lenA > lenB) {
result = 1;
}
break;
case Py_GE:
lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- if(lenA > lenB) {
+ if (lenA > lenB) {
result = 1;
}
else {
@@ -1627,7 +1632,7 @@ static PyObject *Vector_getLength(VectorObject *self, void *UNUSED(closure))
double dot = 0.0f;
int i;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
for (i = 0; i < self->size; i++) {
@@ -1641,10 +1646,10 @@ static int Vector_setLength(VectorObject *self, PyObject *value)
double dot = 0.0f, param;
int i;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return -1;
- if((param=PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
+ if ((param=PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
"length must be set to a number");
return -1;
@@ -1689,7 +1694,7 @@ static PyObject *Vector_getLengthSquared(VectorObject *self, void *UNUSED(closur
double dot = 0.0f;
int i;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
for (i = 0; i < self->size; i++) {
@@ -1708,7 +1713,7 @@ static PyObject *Vector_getSwizzle(VectorObject *self, void *closure)
float vec[MAX_DIMENSIONS];
unsigned int swizzleClosure;
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
/* Unpack the axes from the closure into an array. */
@@ -1717,7 +1722,7 @@ static PyObject *Vector_getSwizzle(VectorObject *self, void *closure)
while (swizzleClosure & SWIZZLE_VALID_AXIS)
{
axis_from = swizzleClosure & SWIZZLE_AXIS;
- if(axis_from >= self->size) {
+ if (axis_from >= self->size) {
PyErr_SetString(PyExc_AttributeError,
"Vector swizzle: "
"specified axis not present");
@@ -1755,7 +1760,7 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
float tvec[MAX_DIMENSIONS];
float vec_assign[MAX_DIMENSIONS];
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return -1;
/* Check that the closure can be used with this vector: even 2D vectors have
@@ -1782,11 +1787,11 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
size_from= axis_from;
}
- else if(PyErr_Clear(), (size_from=mathutils_array_parse(vec_assign, 2, 4, value, "mathutils.Vector.**** = swizzle assignment")) == -1) {
+ else if (PyErr_Clear(), (size_from=mathutils_array_parse(vec_assign, 2, 4, value, "mathutils.Vector.**** = swizzle assignment")) == -1) {
return -1;
}
- if(axis_from != size_from) {
+ if (axis_from != size_from) {
PyErr_SetString(PyExc_AttributeError,
"Vector swizzle: size does not match swizzle");
return -1;
@@ -1806,7 +1811,7 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
memcpy(self->vec, tvec, axis_from * sizeof(float));
/* continue with BaseMathObject_WriteCallback at the end */
- if(BaseMath_WriteCallback(self) == -1)
+ if (BaseMath_WriteCallback(self) == -1)
return -1;
else
return 0;
@@ -2218,8 +2223,8 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
double dot = 0.0f;
int x, y, z= 0, vec_size= vec->size;
- if(mat->col_size != vec_size) {
- if(mat->col_size == 4 && vec_size != 3) {
+ if (mat->col_size != vec_size) {
+ if (mat->col_size == 4 && vec_size != 3) {
PyErr_SetString(PyExc_ValueError,
"vector * matrix: matrix column size "
"and the vector size must be the same");
@@ -2230,7 +2235,7 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
}
}
- if(BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
+ if (BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
return -1;
memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
@@ -2258,7 +2263,7 @@ PyDoc_STRVAR(Vector_negate_doc,
);
static PyObject *Vector_negate(VectorObject *self)
{
- if(BaseMath_ReadCallback(self) == -1)
+ if (BaseMath_ReadCallback(self) == -1)
return NULL;
negate_vn(self->vec, self->size);
@@ -2401,7 +2406,7 @@ PyObject *newVectorObject(float *vec, const int size, const int type, PyTypeObje
{
VectorObject *self;
- if(size > 4 || size < 2) {
+ if (size > 4 || size < 2) {
PyErr_SetString(PyExc_RuntimeError,
"Vector(): invalid size");
return NULL;
@@ -2410,25 +2415,25 @@ PyObject *newVectorObject(float *vec, const int size, const int type, PyTypeObje
self= base_type ? (VectorObject *)base_type->tp_alloc(base_type, 0) :
(VectorObject *)PyObject_GC_New(VectorObject, &vector_Type);
- if(self) {
+ if (self) {
self->size = size;
/* init callbacks as NULL */
self->cb_user= NULL;
self->cb_type= self->cb_subtype= 0;
- if(type == Py_WRAP) {
+ if (type == Py_WRAP) {
self->vec = vec;
self->wrapped = Py_WRAP;
}
else if (type == Py_NEW) {
self->vec= PyMem_Malloc(size * sizeof(float));
- if(vec) {
+ if (vec) {
memcpy(self->vec, vec, size * sizeof(float));
}
else { /* new empty */
fill_vn(self->vec, size, 0.0f);
- if(size == 4) { /* do the homogenous thing */
+ if (size == 4) { /* do the homogenous thing */
self->vec[3] = 1.0f;
}
}
@@ -2445,7 +2450,7 @@ PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_su
{
float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW, NULL);
- if(self) {
+ if (self) {
Py_INCREF(cb_user);
self->cb_user= cb_user;
self->cb_type= (unsigned char)cb_type;
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index a0a6ba277cf..2f79dfd9914 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -48,8 +48,6 @@
#include "BLI_utildefines.h"
#define SWAP_FLOAT(a, b, tmp) tmp=a; a=b; b=tmp
-#define eps 0.000001
-
/*-------------------------DOC STRINGS ---------------------------*/
PyDoc_STRVAR(M_Geometry_doc,
@@ -85,7 +83,14 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject*
float det, inv_det, u, v, t;
int clip= 1;
- if (!PyArg_ParseTuple(args, "O!O!O!O!O!|i:intersect_ray_tri", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &ray, &vector_Type, &ray_off , &clip)) {
+ if (!PyArg_ParseTuple(args,
+ "O!O!O!O!O!|i:intersect_ray_tri",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &ray,
+ &vector_Type, &ray_off, &clip))
+ {
return NULL;
}
if (vec1->size != 3 || vec2->size != 3 || vec3->size != 3 || ray->size != 3 || ray_off->size != 3) {
@@ -94,8 +99,14 @@ 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;
+ }
copy_v3_v3(v1, vec1->vec);
copy_v3_v3(v2, vec2->vec);
@@ -173,17 +184,28 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
VectorObject *vec1, *vec2, *vec3, *vec4;
float v1[3], v2[3], v3[3], v4[3], i1[3], i2[3];
- if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &vec4))
+ {
return NULL;
}
+
if (vec1->size != vec2->size || vec1->size != vec3->size || vec3->size != vec2->size) {
PyErr_SetString(PyExc_ValueError,
"vectors must be of the same size");
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;
+ }
if (vec1->size == 3 || vec1->size == 2) {
int result;
@@ -257,9 +279,14 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
float n[3];
if (PyTuple_GET_SIZE(args) == 3) {
- if (!PyArg_ParseTuple(args, "O!O!O!:normal", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!:normal",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3))
+ {
return NULL;
}
+
if (vec1->size != vec2->size || vec1->size != vec3->size) {
PyErr_SetString(PyExc_ValueError,
"vectors must be of the same size");
@@ -271,13 +298,22 @@ 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;
+ }
normal_tri_v3(n, vec1->vec, vec2->vec, vec3->vec);
}
else {
- if (!PyArg_ParseTuple(args, "O!O!O!O!:normal", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!O!:normal",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &vec4))
+ {
return NULL;
}
if (vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) {
@@ -291,8 +327,13 @@ 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;
+ }
normal_quad_v3(n, vec1->vec, vec2->vec, vec3->vec, vec4->vec);
}
@@ -319,7 +360,11 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
{
VectorObject *vec1, *vec2, *vec3;
- if (!PyArg_ParseTuple(args, "O!O!O!:area_tri", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!:area_tri",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3))
+ {
return NULL;
}
@@ -329,8 +374,12 @@ 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;
+ }
if (vec1->size == 3) {
return PyFloat_FromDouble(area_tri_v3(vec1->vec, vec2->vec, vec3->vec));
@@ -367,16 +416,21 @@ static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObj
VectorObject *line_a1, *line_a2, *line_b1, *line_b2;
float vi[2];
if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line_2d",
- &vector_Type, &line_a1,
- &vector_Type, &line_a2,
- &vector_Type, &line_b1,
- &vector_Type, &line_b2)
- ) {
+ &vector_Type, &line_a1,
+ &vector_Type, &line_a2,
+ &vector_Type, &line_b1,
+ &vector_Type, &line_b2))
+ {
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;
+ }
if (isect_seg_seg_v2_point(line_a1->vec, line_a2->vec, line_b1->vec, line_b2->vec, vi) == 1) {
return newVectorObject(vi, 2, Py_NEW, NULL);
@@ -411,20 +465,20 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
int no_flip= 0;
float isect[3];
if (!PyArg_ParseTuple(args, "O!O!O!O!|i:intersect_line_plane",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &plane_co,
- &vector_Type, &plane_no,
- &no_flip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &plane_co,
+ &vector_Type, &plane_no,
+ &no_flip))
+ {
return NULL;
}
if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
BaseMath_ReadCallback(plane_co) == -1 ||
- BaseMath_ReadCallback(plane_no) == -1
- ) {
+ BaseMath_ReadCallback(plane_no) == -1)
+ {
return NULL;
}
@@ -443,6 +497,65 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
}
}
+PyDoc_STRVAR(M_Geometry_intersect_plane_plane_doc,
+".. function:: intersect_plane_plane(plane_a_co, plane_a_no, plane_b_co, plane_b_no)\n"
+"\n"
+" Return the intersection between two planes\n"
+"\n"
+" :arg plane_a_co: Point on the first plane\n"
+" :type plane_a_co: :class:`mathutils.Vector`\n"
+" :arg plane_a_no: Normal of the first plane\n"
+" :type plane_a_no: :class:`mathutils.Vector`\n"
+" :arg plane_b_co: Point on the second plane\n"
+" :type plane_b_co: :class:`mathutils.Vector`\n"
+" :arg plane_b_no: Normal of the second plane\n"
+" :type plane_b_no: :class:`mathutils.Vector`\n"
+" :return: The line of the intersection represented as a point and a vector\n"
+" :rtype: tuple pair of :class:`mathutils.Vector`\n"
+);
+static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObject* args)
+{
+ PyObject *ret;
+ VectorObject *plane_a_co, *plane_a_no, *plane_b_co, *plane_b_no;
+
+ float isect_co[3];
+ float isect_no[3];
+
+ if (!PyArg_ParseTuple(args, "O!O!O!O!|i:intersect_plane_plane",
+ &vector_Type, &plane_a_co,
+ &vector_Type, &plane_a_no,
+ &vector_Type, &plane_b_co,
+ &vector_Type, &plane_b_no))
+ {
+ 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)
+ {
+ return NULL;
+ }
+
+ if (ELEM4(2, plane_a_co->size, plane_a_no->size, plane_b_co->size, plane_b_no->size)) {
+ PyErr_SetString(PyExc_ValueError,
+ "geometry.intersect_plane_plane(...): "
+ " can't use 2D Vectors");
+ return NULL;
+ }
+
+ isect_plane_plane_v3(isect_co, isect_no,
+ plane_a_co->vec, plane_a_no->vec,
+ plane_b_co->vec, plane_b_no->vec);
+
+ normalize_v3(isect_no);
+
+ ret= PyTuple_New(2);
+ PyTuple_SET_ITEM(ret, 0, newVectorObject(isect_co, 3, Py_NEW, NULL));
+ PyTuple_SET_ITEM(ret, 1, newVectorObject(isect_no, 3, Py_NEW, NULL));
+ return ret;
+}
PyDoc_STRVAR(M_Geometry_intersect_line_sphere_doc,
".. function:: intersect_line_sphere(line_a, line_b, sphere_co, sphere_radius, clip=True)\n"
@@ -471,18 +584,18 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
float isect_b[3];
if (!PyArg_ParseTuple(args, "O!O!O!f|i:intersect_line_sphere",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &sphere_co,
- &sphere_radius, &clip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &sphere_co,
+ &sphere_radius, &clip))
+ {
return NULL;
}
- if ( BaseMath_ReadCallback(line_a) == -1 ||
+ if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1
- ) {
+ BaseMath_ReadCallback(sphere_co) == -1)
+ {
return NULL;
}
@@ -551,18 +664,18 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
float isect_b[3];
if (!PyArg_ParseTuple(args, "O!O!O!f|i:intersect_line_sphere_2d",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &sphere_co,
- &sphere_radius, &clip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &sphere_co,
+ &sphere_radius, &clip))
+ {
return NULL;
}
if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1
- ) {
+ BaseMath_ReadCallback(sphere_co) == -1)
+ {
return NULL;
}
else {
@@ -617,16 +730,20 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
PyObject *ret;
if (!PyArg_ParseTuple(args, "O!O!O!:intersect_point_line",
- &vector_Type, &pt,
- &vector_Type, &line_1,
- &vector_Type, &line_2)
- ) {
+ &vector_Type, &pt,
+ &vector_Type, &line_1,
+ &vector_Type, &line_2))
+ {
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);}
else { pt_in[2]=0.0; copy_v2_v2(pt_in, pt->vec); }
@@ -666,17 +783,22 @@ static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObj
VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3;
if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_point_tri_2d",
- &vector_Type, &pt_vec,
- &vector_Type, &tri_p1,
- &vector_Type, &tri_p2,
- &vector_Type, &tri_p3)
- ) {
+ &vector_Type, &pt_vec,
+ &vector_Type, &tri_p1,
+ &vector_Type, &tri_p2,
+ &vector_Type, &tri_p3))
+ {
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;
-
+ }
+
return PyLong_FromLong(isect_point_tri_v2(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec));
}
@@ -702,18 +824,24 @@ static PyObject *M_Geometry_intersect_point_quad_2d(PyObject *UNUSED(self), PyOb
VectorObject *pt_vec, *quad_p1, *quad_p2, *quad_p3, *quad_p4;
if (!PyArg_ParseTuple(args, "O!O!O!O!O!:intersect_point_quad_2d",
- &vector_Type, &pt_vec,
- &vector_Type, &quad_p1,
- &vector_Type, &quad_p2,
- &vector_Type, &quad_p3,
- &vector_Type, &quad_p4)
- ) {
+ &vector_Type, &pt_vec,
+ &vector_Type, &quad_p1,
+ &vector_Type, &quad_p2,
+ &vector_Type, &quad_p3,
+ &vector_Type, &quad_p4))
+ {
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;
-
+ }
+
return PyLong_FromLong(isect_point_quad_v2(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec));
}
@@ -738,8 +866,8 @@ static PyObject *M_Geometry_distance_point_to_plane(PyObject *UNUSED(self), PyOb
if (!PyArg_ParseTuple(args, "O!O!O!:distance_point_to_plane",
&vector_Type, &pt,
&vector_Type, &plene_co,
- &vector_Type, &plane_no)
- ) {
+ &vector_Type, &plane_no))
+ {
return NULL;
}
@@ -783,14 +911,14 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje
float vec[3];
if (!PyArg_ParseTuple(args, "O!O!O!O!O!O!O!:barycentric_transform",
- &vector_Type, &vec_pt,
- &vector_Type, &vec_t1_src,
- &vector_Type, &vec_t2_src,
- &vector_Type, &vec_t3_src,
- &vector_Type, &vec_t1_tar,
- &vector_Type, &vec_t2_tar,
- &vector_Type, &vec_t3_tar)
- ) {
+ &vector_Type, &vec_pt,
+ &vector_Type, &vec_t1_src,
+ &vector_Type, &vec_t2_src,
+ &vector_Type, &vec_t3_src,
+ &vector_Type, &vec_t1_tar,
+ &vector_Type, &vec_t2_tar,
+ &vector_Type, &vec_t3_tar))
+ {
return NULL;
}
@@ -850,11 +978,11 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject*
if (!PyArg_ParseTuple(args, "O!O!O!O!i:interpolate_bezier",
- &vector_Type, &vec_k1,
- &vector_Type, &vec_h1,
- &vector_Type, &vec_h2,
- &vector_Type, &vec_k2, &resolu)
- ) {
+ &vector_Type, &vec_k1,
+ &vector_Type, &vec_h1,
+ &vector_Type, &vec_h2,
+ &vector_Type, &vec_k2, &resolu))
+ {
return NULL;
}
@@ -864,8 +992,13 @@ 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;
+ }
dims= MAX4(vec_k1->size, vec_h1->size, vec_h2->size, vec_k2->size);
@@ -1137,6 +1270,7 @@ static PyMethodDef M_Geometry_methods[]= {
{"intersect_line_line", (PyCFunction) M_Geometry_intersect_line_line, METH_VARARGS, M_Geometry_intersect_line_line_doc},
{"intersect_line_line_2d", (PyCFunction) M_Geometry_intersect_line_line_2d, METH_VARARGS, M_Geometry_intersect_line_line_2d_doc},
{"intersect_line_plane", (PyCFunction) M_Geometry_intersect_line_plane, METH_VARARGS, M_Geometry_intersect_line_plane_doc},
+ {"intersect_plane_plane", (PyCFunction) M_Geometry_intersect_plane_plane, METH_VARARGS, M_Geometry_intersect_plane_plane_doc},
{"intersect_line_sphere", (PyCFunction) M_Geometry_intersect_line_sphere, METH_VARARGS, M_Geometry_intersect_line_sphere_doc},
{"intersect_line_sphere_2d", (PyCFunction) M_Geometry_intersect_line_sphere_2d, METH_VARARGS, M_Geometry_intersect_line_sphere_2d_doc},
{"distance_point_to_plane", (PyCFunction) M_Geometry_distance_point_to_plane, METH_VARARGS, M_Geometry_distance_point_to_plane_doc},
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 5ed920ca2dc..9982eb86460 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -75,6 +75,7 @@ set(SRC
intern/source/sss.c
intern/source/strand.c
intern/source/sunsky.c
+ intern/source/texture_ocean.c
intern/source/volume_precache.c
intern/source/volumetric.c
intern/source/voxeldata.c
@@ -105,6 +106,7 @@ set(SRC
intern/include/strand.h
intern/include/sunsky.h
intern/include/texture.h
+ intern/include/texture_ocean.h
intern/include/volume_precache.h
intern/include/volumetric.h
intern/include/voxeldata.h
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index 2e6e8fa2099..4fe8829eee2 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -188,6 +188,7 @@ void RE_SetDispRect (struct Render *re, rcti *disprect);
/* set up the viewplane/perspective matrix, three choices */
struct Object *RE_GetCamera(struct Render *re); /* return camera override if set */
void RE_SetCamera(struct Render *re, struct Object *camera);
+void RE_SetEnvmapCamera(struct Render *re, struct Object *cam_ob, float viewscale, float clipsta, float clipend);
void RE_SetWindow (struct Render *re, rctf *viewplane, float clipsta, float clipend);
void RE_SetOrtho (struct Render *re, rctf *viewplane, float clipsta, float clipend);
void RE_SetPixelSize(struct Render *re, float pixsize);
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index dce7484d702..9e522fae4e4 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -152,10 +152,7 @@ struct Render
int partx, party;
/* values for viewing */
- float lens;
- float sensor_x, sensor_y; /* image sensor size, same variable in camera */
float ycor; /* (scene->xasp / scene->yasp), multiplied with 'winy' */
- short sensor_fit;
float panophi, panosi, panoco, panodxp, panodxv;
diff --git a/source/blender/render/intern/include/texture_ocean.h b/source/blender/render/intern/include/texture_ocean.h
new file mode 100644
index 00000000000..b0a0647d115
--- /dev/null
+++ b/source/blender/render/intern/include/texture_ocean.h
@@ -0,0 +1,28 @@
+/*
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: Matt Ebb
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+void prepare_ocean_tex_modifier(struct OceanTex *ot);
+
+int ocean_texture(struct Tex *tex, float *texvec, struct TexResult *texres);
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 8e729b827cd..48625192fb2 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -5325,7 +5325,7 @@ static void speedvector_project(Render *re, float zco[2], const float co[3], con
if(vec[0]<0.0f) ang= -ang;
zco[0]= ang/pixelphix + zmulx;
- ang= 0.5f*M_PI - saacos(vec[1]/sqrtf(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]));
+ ang= 0.5f*(float)M_PI - saacos(vec[1]/sqrtf(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]));
zco[1]= ang/pixelphiy + zmuly;
}
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index 62cb29c3d5f..3512ffa865b 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -131,6 +131,7 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf)
static Render *envmap_render_copy(Render *re, EnvMap *env)
{
Render *envre;
+ float viewscale;
int cuberes;
envre= RE_NewRender("Envmap");
@@ -156,15 +157,8 @@ static Render *envmap_render_copy(Render *re, EnvMap *env)
envre->lay= re->lay;
/* view stuff in env render */
- envre->lens= 16.0f;
- envre->sensor_x= 32.0f;
- if(env->type==ENV_PLANE)
- envre->lens*= env->viewscale;
- envre->ycor= 1.0f;
- envre->clipsta= env->clipsta; /* render_scene_set_window() respects this for now */
- envre->clipend= env->clipend;
-
- RE_SetCamera(envre, env->object);
+ viewscale= (env->type == ENV_PLANE)? env->viewscale: 1.0f;
+ RE_SetEnvmapCamera(envre, env->object, viewscale, env->clipsta, env->clipend);
/* callbacks */
envre->display_draw= re->display_draw;
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index b7f89e260a8..38ace8d5121 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -283,6 +283,11 @@ int RE_engine_render(Render *re, int do_all)
if(re->result==NULL)
return 1;
+ /* set render info */
+ re->i.cfra= re->scene->r.cfra;
+ BLI_strncpy(re->i.scenename, re->scene->id.name+2, sizeof(re->i.scenename));
+ re->i.totface=re->i.totvert=re->i.totstrand=re->i.totlamp=re->i.tothalo= 0;
+
/* render */
engine = RE_engine_create(type);
engine->re= re;
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c
index 7bd8dad6502..b7254cd1221 100644
--- a/source/blender/render/intern/source/initrender.c
+++ b/source/blender/render/intern/source/initrender.c
@@ -451,15 +451,64 @@ struct Object *RE_GetCamera(Render *re)
return re->camera_override ? re->camera_override : re->scene->camera;
}
+static void re_camera_params_get(Render *re, CameraParams *params, Object *cam_ob)
+{
+ copy_m4_m4(re->winmat, params->winmat);
+
+ re->clipsta= params->clipsta;
+ re->clipend= params->clipend;
+
+ re->ycor= params->ycor;
+ re->viewdx= params->viewdx;
+ re->viewdy= params->viewdy;
+ re->viewplane= params->viewplane;
+
+ object_camera_mode(&re->r, cam_ob);
+}
+
+void RE_SetEnvmapCamera(Render *re, Object *cam_ob, float viewscale, float clipsta, float clipend)
+{
+ CameraParams params;
+
+ /* setup parameters */
+ camera_params_init(&params);
+ camera_params_from_object(&params, cam_ob);
+
+ params.lens= 16.0f*viewscale;
+ params.sensor_x= 32.0f;
+ params.sensor_y= 32.0f;
+ params.sensor_fit = CAMERA_SENSOR_FIT_AUTO;
+ params.clipsta= clipsta;
+ params.clipend= clipend;
+
+ /* compute matrix, viewplane, .. */
+ camera_params_compute_viewplane(&params, re->winx, re->winy, 1.0f, 1.0f);
+ camera_params_compute_matrix(&params);
+
+ /* extract results */
+ re_camera_params_get(re, &params, cam_ob);
+}
+
/* call this after InitState() */
/* per render, there's one persistent viewplane. Parts will set their own viewplanes */
-void RE_SetCamera(Render *re, Object *camera)
+void RE_SetCamera(Render *re, Object *cam_ob)
{
- object_camera_mode(&re->r, camera);
+ CameraParams params;
+
+ /* setup parameters */
+ camera_params_init(&params);
+ camera_params_from_object(&params, cam_ob);
+
+ params.use_fields= (re->r.mode & R_FIELDS);
+ params.field_second= (re->flag & R_SEC_FIELD);
+ params.field_odd= (re->r.mode & R_ODDFIELD);
+
+ /* compute matrix, viewplane, .. */
+ camera_params_compute_viewplane(&params, re->winx, re->winy, re->r.xasp, re->r.yasp);
+ camera_params_compute_matrix(&params);
- object_camera_matrix(&re->r, camera, re->winx, re->winy, re->flag & R_SEC_FIELD,
- re->winmat, &re->viewplane, &re->clipsta, &re->clipend,
- &re->lens, &re->sensor_x, &re->sensor_y, &re->sensor_fit, &re->ycor, &re->viewdx, &re->viewdy);
+ /* extract results */
+ re_camera_params_get(re, &params, cam_ob);
}
void RE_SetPixelSize(Render *re, float pixsize)
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index d4cd6e1da92..c3d7f79b61f 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -134,7 +134,7 @@ Render R;
/* ********* alloc and free ******** */
-static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, const char *name_override);
+static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override);
static volatile int g_break= 0;
static int thread_break(void *UNUSED(arg))
@@ -3040,10 +3040,10 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr
}
else {
char name[FILE_MAX];
- BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE);
-
+ BKE_makepicstring(name, scene->r.pic, bmain->name, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE);
+
/* reports only used for Movie */
- do_write_image_or_movie(re, scene, NULL, name);
+ do_write_image_or_movie(re, bmain, scene, NULL, name);
}
}
@@ -3063,7 +3063,7 @@ void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene)
re->result_ok= 1;
}
-static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, const char *name_override)
+static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override)
{
char name[FILE_MAX];
RenderResult rres;
@@ -3091,7 +3091,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, c
if(name_override)
BLI_strncpy(name, name_override, sizeof(name));
else
- BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, scene->r.pic, bmain->name, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
if(re->r.imtype==R_MULTILAYER) {
if(re->result) {
@@ -3194,7 +3194,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
do_render_all_options(re);
if(re->test_break(re->tbh) == 0) {
- if(!do_write_image_or_movie(re, scene, mh, NULL))
+ if(!do_write_image_or_movie(re, bmain, scene, mh, NULL))
G.afbreek= 1;
}
@@ -3236,7 +3236,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
/* Touch/NoOverwrite options are only valid for image's */
if(BKE_imtype_is_movie(scene->r.imtype) == 0) {
if(scene->r.mode & (R_NO_OVERWRITE | R_TOUCH))
- BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, scene->r.pic, bmain->name, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, TRUE);
if(scene->r.mode & R_NO_OVERWRITE && BLI_exists(name)) {
printf("skipping existing frame \"%s\"\n", name);
@@ -3258,7 +3258,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
if(re->test_break(re->tbh) == 0) {
if(!G.afbreek)
- if(!do_write_image_or_movie(re, scene, mh, NULL))
+ if(!do_write_image_or_movie(re, bmain, scene, mh, NULL))
G.afbreek= 1;
}
else
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index afc52f7c92a..323f04cbd04 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -79,6 +79,7 @@
#include "rendercore.h"
#include "shading.h"
#include "texture.h"
+#include "texture_ocean.h"
#include "renderdatabase.h" /* needed for UV */
@@ -1264,7 +1265,9 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
case TEX_VOXELDATA:
retval= voxeldatatex(tex, texvec, texres);
break;
-
+ case TEX_OCEAN:
+ retval= ocean_texture(tex, texvec, texres);
+ break;
}
if (tex->flag & TEX_COLORBAND) {
@@ -2193,6 +2196,12 @@ void do_material_tex(ShadeInput *shi, Render *re)
use_ntap_bump = 0;
use_compat_bump = 1;
}
+
+ /* case ocean */
+ if(tex->type == TEX_OCEAN) {
+ use_ntap_bump = 0;
+ use_compat_bump = 0;
+ }
/* which coords */
if(mtex->texco==TEXCO_ORCO) {
@@ -2998,7 +3007,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
float *co, fact, stencilTin=1.0;
float tempvec[3], texvec[3], dxt[3], dyt[3];
- int tex_nr, rgb= 0, ok;
+ int tex_nr, rgb= 0;
if (R.r.scemode & R_NO_TEX) return;
/* todo: add flag to test if there's a tex */
@@ -3162,18 +3171,21 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
texture_rgb_blend(hor, tcol, hor, texres.tin, mtex->colfac, mtex->blendtype);
}
if(mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) {
- ok= 0;
+ float zenfac = 0.0f;
+
if(R.wrld.skytype & WO_SKYREAL) {
if((skyflag & WO_ZENUP)) {
- if(mtex->mapto & WOMAP_ZENUP) ok= 1;
+ if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
}
- else if(mtex->mapto & WOMAP_ZENDOWN) ok= 1;
+ else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
}
- else ok= 1;
-
- if(ok) {
- texture_rgb_blend(zen, tcol, zen, texres.tin, mtex->colfac, mtex->blendtype);
+ else {
+ if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
+ else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
}
+
+ if(zenfac != 0.0f)
+ texture_rgb_blend(zen, tcol, zen, texres.tin, zenfac, mtex->blendtype);
}
}
if(mtex->mapto & WOMAP_BLEND) {
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index ad964a74b36..d82ccd05c1e 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -55,6 +55,8 @@
#include "sss.h"
#include "texture.h"
+#include "shading.h" /* own include */
+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
/* only to be used here in this file, it's for speed */
diff --git a/source/blender/render/intern/source/texture_ocean.c b/source/blender/render/intern/source/texture_ocean.c
new file mode 100644
index 00000000000..c13347dc162
--- /dev/null
+++ b/source/blender/render/intern/source/texture_ocean.c
@@ -0,0 +1,157 @@
+/*
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: Matt Ebb
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stddef.h>
+
+#include "BLI_math.h"
+#include "BLI_utildefines.h"
+
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_texture_types.h"
+
+#include "BKE_global.h" /* XXX */
+
+#include "BKE_modifier.h"
+#include "BKE_ocean.h"
+#include "BKE_utildefines.h"
+
+#include "render_types.h"
+#include "RE_shader_ext.h"
+
+#include "texture.h"
+
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
+/* only to be used here in this file, it's for speed */
+extern struct Render R;
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+
+
+
+/* ***** actual texture sampling ***** */
+int ocean_texture(Tex *tex, float *texvec, TexResult *texres)
+{
+ OceanTex *ot= tex->ot;
+ ModifierData *md;
+ OceanModifierData *omd;
+
+ texres->tin = 0.0f;
+
+ if ( !(ot) ||
+ !(ot->object) ||
+ !(md = (ModifierData *)modifiers_findByType(ot->object, eModifierType_Ocean)) ||
+ !(omd= (OceanModifierData *)md)->ocean)
+ {
+ return 0;
+ }
+ else {
+ const int do_normals = (omd->flag & MOD_OCEAN_GENERATE_NORMALS);
+ int cfra = R.r.cfra;
+ int retval = TEX_INT;
+
+ OceanResult ocr;
+ const float u = 0.5f+0.5f*texvec[0];
+ const float v = 0.5f+0.5f*texvec[1];
+
+ if (omd->oceancache && omd->cached==TRUE) {
+
+ CLAMP(cfra, omd->bakestart, omd->bakeend);
+ cfra -= omd->bakestart; // shift to 0 based
+
+ BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra, u, v);
+
+ }
+ else { // non-cached
+
+ if (G.rendering)
+ BKE_ocean_eval_uv_catrom(omd->ocean, &ocr, u, v);
+ else
+ BKE_ocean_eval_uv(omd->ocean, &ocr, u, v);
+
+ ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, omd->foam_coverage);
+ }
+
+ switch (ot->output) {
+ case TEX_OCN_DISPLACEMENT:
+ /* XYZ displacement */
+ texres->tr = 0.5f + 0.5f * ocr.disp[0];
+ texres->tg = 0.5f + 0.5f * ocr.disp[2];
+ texres->tb = 0.5f + 0.5f * ocr.disp[1];
+
+ texres->tr = MAX2(0.0f, texres->tr);
+ texres->tg = MAX2(0.0f, texres->tg);
+ texres->tb = MAX2(0.0f, texres->tb);
+
+ BRICONTRGB;
+
+ retval = TEX_RGB;
+ break;
+
+ case TEX_OCN_EMINUS:
+ /* -ve eigenvectors ? */
+ texres->tr = ocr.Eminus[0];
+ texres->tg = ocr.Eminus[2];
+ texres->tb = ocr.Eminus[1];
+ retval = TEX_RGB;
+ break;
+
+ case TEX_OCN_EPLUS:
+ /* -ve eigenvectors ? */
+ texres->tr = ocr.Eplus[0];
+ texres->tg = ocr.Eplus[2];
+ texres->tb = ocr.Eplus[1];
+ retval = TEX_RGB;
+ break;
+
+ case TEX_OCN_JPLUS:
+ texres->tin = ocr.Jplus;
+ retval = TEX_INT;
+ break;
+
+ case TEX_OCN_FOAM:
+
+ texres->tin = ocr.foam;
+
+ BRICONT;
+
+ retval = TEX_INT;
+ break;
+ }
+
+ /* if normals needed */
+
+ if (texres->nor && do_normals) {
+ normalize_v3_v3(texres->nor, ocr.normal);
+ retval |= TEX_NOR;
+ }
+
+ texres->ta = 1.0f;
+
+ return retval;
+ }
+}
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 8b55db27761..fcdb6d25083 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -233,7 +233,6 @@ void WM_operator_py_idname(char *to, const char *from);
void WM_menutype_init(void);
struct MenuType *WM_menutype_find(const char *idname, int quiet);
int WM_menutype_add(struct MenuType* mt);
-int WM_menutype_contains(struct MenuType* mt);
void WM_menutype_freelink(struct MenuType* mt);
void WM_menutype_free(void);
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index 250752e661a..f254358e3cf 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -92,7 +92,7 @@ void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *key
const char *WM_key_event_string(short type);
int WM_key_event_operator_id(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, int hotkey, struct wmKeyMap **keymap_r);
-char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, char *str, int len);
+char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const short sloppy, char *str, int len);
#ifdef __cplusplus
}
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 10c3735685c..c6c67e22bfd 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -175,26 +175,6 @@ int WM_menutype_add(MenuType* mt)
return 1;
}
-/* inefficient but only used for tooltip code */
-int WM_menutype_contains(MenuType* mt)
-{
- int found= FALSE;
-
- if(mt) {
- GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash);
-
- for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- if(mt == BLI_ghashIterator_getValue(iter)) {
- found= TRUE;
- break;
- }
- }
- BLI_ghashIterator_free(iter);
- }
-
- return found;
-}
-
void WM_menutype_freelink(MenuType* mt)
{
BLI_ghash_remove(menutypes_hash, mt->idname, NULL, (GHashValFreeFP)MEM_freeN);
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index c19523cbaee..e17441873d5 100644
--- a/source/blender/windowmanager/intern/wm_apple.c
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -98,8 +98,8 @@ static int checkAppleVideoCard(void)
StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit);
abort();
}
-CGLDestroyRendererInfo (rend);
-return 0;
+ CGLDestroyRendererInfo (rend);
+ return 0;
}
static void getMacAvailableBounds(short *top, short *left, short *bottom, short *right)
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 4342c9f4bff..a7c3e973a39 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -636,7 +636,7 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
}
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);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 8d7e812a386..1a7031c7d31 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -155,8 +155,9 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
CTX_wm_window_set(C, active_win);
ED_editors_exit(C);
-
-return;
+
+ /* 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;
@@ -168,6 +169,7 @@ return;
//BLI_addtail(screenbase, win->screen);
}
}
+#endif
}
/* match old WM with new, 4 cases:
@@ -193,9 +195,10 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
/* we've read file without wm..., keep current one entirely alive */
if(G.main->wm.first==NULL) {
+ bScreen *screen= NULL;
+
/* when loading without UI, no matching needed */
- if(!(G.fileflags & G_FILE_NO_UI)) {
- bScreen *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) {
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 9957d24c7ab..2e191a5ab6d 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -852,19 +852,19 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, const char *op
return found;
}
-static wmKeyMapItem *wm_keymap_item_find(const bContext *C, const char *opname, int opcontext, IDProperty *properties, int hotkey, wmKeyMap **keymap_r)
+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)
{
wmKeyMapItem *found= wm_keymap_item_find_props(C, opname, opcontext, properties, 1, hotkey, keymap_r);
- if(!found)
+ 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, char *str, int len)
+char *WM_key_event_operator_string(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, NULL);
+ wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL);
if(kmi) {
WM_keymap_item_to_string(kmi, str, len);
@@ -876,7 +876,7 @@ char *WM_key_event_operator_string(const bContext *C, const char *opname, int op
int WM_key_event_operator_id(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, keymap_r);
+ wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r);
if(kmi)
return kmi->id;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 4367a8b03ef..0c538865501 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -597,7 +597,7 @@ void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, con
{
if(*properties==NULL) {
IDPropertyTemplate val = {0};
- *properties= IDP_New(IDP_GROUP, val, "wmOpItemProp");
+ *properties= IDP_New(IDP_GROUP, &val, "wmOpItemProp");
}
if(*ptr==NULL) {
@@ -1362,7 +1362,7 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons
/* check for hotkey */
if(len < 256-6) {
- if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1))
+ if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, &name[len+1], 256-len-1))
name[len]= '|';
}
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 79696b4d408..3a1c0da4c4d 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -264,7 +264,8 @@ void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){}
int ED_view3d_scene_layer_set(int lay, const int *values){return 0;}
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){}
void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist){}
-struct BGpic *ED_view3D_background_image_add(struct View3D *v3d){return (struct BGpic *) NULL;}
+struct BGpic *ED_view3D_background_image_new(struct View3D *v3d){return (struct BGpic *) NULL;}
+void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic){}
void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){}
int text_file_modified(struct Text *text){return 0;}
void ED_node_shader_default(struct Material *ma){}
@@ -354,7 +355,7 @@ void uiItemS(struct uiLayout *layout){}
void uiItemFullR(struct uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon){}
void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){}
char *uiLayoutIntrospect(struct uiLayout *layout){return (char *)NULL;}
-void UI_reinit_font() {}
+void UI_reinit_font(void) {}
/* rna template */
void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text){}
@@ -457,7 +458,7 @@ void BPY_text_free_code(struct Text *text) {}
void BPY_id_release(struct Text *text) {}
int BPY_context_member_get(struct Context *C, const char *member, struct bContextDataResult *result) { return 0; }
void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct) {}
-float BPY_driver_exec(struct ChannelDriver *driver) {return 0.0f;} /* might need this one! */
+float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime) {return 0.0f;} /* might need this one! */
void BPY_DECREF(void *pyob_ptr) {}
void BPY_pyconstraint_exec(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets) {}
void macro_wrapper(struct wmOperatorType *ot, void *userdata) {} ;
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 89dbf740739..11147193cf6 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -234,10 +234,6 @@ else()
set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
endif()
-
-# -----------------------------------------------------------------------------
-# Install Targets
-
set(BLENDER_TEXT_FILES
${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
@@ -245,8 +241,11 @@ set(BLENDER_TEXT_FILES
${CMAKE_SOURCE_DIR}/release/text/readme.html
)
-if(UNIX AND NOT APPLE)
+# -----------------------------------------------------------------------------
+# Platform Spesific Var: TARGETDIR_VER
+
+if(UNIX AND NOT APPLE)
if(WITH_INSTALL_PORTABLE)
set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
else()
@@ -257,18 +256,71 @@ if(UNIX AND NOT APPLE)
endif()
endif()
- # important to make a clean install each time
- # else old scripts get loaded.
+elseif(WIN32)
+ set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
+
+elseif(APPLE)
+ set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION})
+
+endif()
+
+
+# -----------------------------------------------------------------------------
+# Install Targets (Generic, All Platforms)
+
+
+# important to make a clean install each time, else old scripts get loaded.
+install(
+ CODE
+ "file(REMOVE_RECURSE ${TARGETDIR_VER})"
+)
+
+if(WITH_PYTHON)
+ # install(CODE "message(\"copying blender scripts...\")")
+
+ # exclude addons_contrib if release
+ if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
+ set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
+ else()
+ set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything
+ endif()
+
install(
- CODE
- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
+ DESTINATION ${TARGETDIR_VER}
+ PATTERN ".svn" EXCLUDE
+ PATTERN "__pycache__" EXCLUDE
+ PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
)
+
+ unset(ADDON_EXCLUDE_CONDITIONAL)
+endif()
+# localization
+if(WITH_INTERNATIONAL)
+ install(
+ DIRECTORY
+ ${CMAKE_SOURCE_DIR}/release/datafiles/locale
+ ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
+ DESTINATION ${TARGETDIR_VER}/datafiles
+ PATTERN ".svn" EXCLUDE
+ )
+endif()
+
+# helpful tip when using make
+if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
# message after building.
add_custom_command(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${TARGETDIR_VER}'
+ COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
)
+endif()
+
+
+# -----------------------------------------------------------------------------
+# Install Targets (Platform Specific)
+
+if(UNIX AND NOT APPLE)
# there are a few differences between portable and system install
if(WITH_INSTALL_PORTABLE)
@@ -349,16 +401,6 @@ if(UNIX AND NOT APPLE)
)
endif()
- if(WITH_INTERNATIONAL)
- install(
- DIRECTORY
- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
- DESTINATION ${TARGETDIR_VER}/datafiles
- PATTERN ".svn" EXCLUDE
- )
- endif()
-
# plugins in blender 2.5 don't work at the moment.
#
# install(
@@ -368,14 +410,6 @@ if(UNIX AND NOT APPLE)
# )
if(WITH_PYTHON)
- # install(CODE "message(\"copying blender scripts...\")")
- install(
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
- DESTINATION ${TARGETDIR_VER}
- PATTERN ".svn" EXCLUDE
- PATTERN "__pycache__" EXCLUDE
- )
-
if(WITH_PYTHON_INSTALL)
# Copy the systems python into the install directory
# Scons copy in tools/Blender.py
@@ -404,27 +438,12 @@ if(UNIX AND NOT APPLE)
endif()
elseif(WIN32)
- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
-
- install( # same as linux!, deduplicate
- CODE
- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
- )
-
- install( # same as linux!, deduplicate
+ install(
FILES ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
)
- if(WITH_INTERNATIONAL) # same as linux!, deduplicate
- install(
- DIRECTORY
- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
- DESTINATION ${TARGETDIR_VER}/datafiles
- PATTERN ".svn" EXCLUDE
- )
-
+ if(WITH_INTERNATIONAL)
install(
FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
DESTINATION ${TARGETDIR}
@@ -447,13 +466,6 @@ elseif(WIN32)
# )
if(WITH_PYTHON)
- # install(CODE "message(\"copying blender scripts...\")")
- install( # same as linux!, deduplicate
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
- DESTINATION ${TARGETDIR_VER}
- PATTERN ".svn" EXCLUDE
- PATTERN "__pycache__" EXCLUDE
- )
install(
FILES ${LIBDIR}/python/lib/python32.dll
@@ -585,29 +597,6 @@ elseif(WIN32)
endif()
elseif(APPLE)
- set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
- set(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
- set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION})
-
- # setup Info.plist
- execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- set_target_properties(blender PROPERTIES
- MACOSX_BUNDLE_INFO_PLIST ${SOURCEINFO}
- MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
- MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
-
- # important to make a clean install each time else old scripts get loaded.
- install(
- CODE
- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
- )
-
- # message after building.
- add_custom_command(
- TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${TARGETDIR_VER}'
- )
# handy install macro to exclude files, we use \$ escape for the "to"
# argument when calling so ${BUILD_TYPE} does not get expanded
@@ -626,6 +615,17 @@ elseif(APPLE)
)
endmacro()
+ set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
+
+ # setup Info.plist
+ execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ set_target_properties(blender PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
+ MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
+ MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
+
+
# install release and app files
install(
FILES ${BLENDER_TEXT_FILES}
@@ -633,26 +633,15 @@ elseif(APPLE)
)
install(
- FILES ${SOURCEDIR}/Contents/PkgInfo
+ FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
DESTINATION ${TARGETDIR}/blender.app/Contents
)
install_dir(
- ${SOURCEDIR}/Contents/Resources
+ ${OSX_APP_SOURCEDIR}/Contents/Resources
\${TARGETDIR}/blender.app/Contents/
)
- # localization
- if(WITH_INTERNATIONAL)
- install(
- DIRECTORY
- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
- DESTINATION ${TARGETDIR_VER}/datafiles
- PATTERN ".svn" EXCLUDE
- )
- endif()
-
# python
if(WITH_PYTHON)
# the python zip is first extract as part of the build process,
@@ -679,18 +668,13 @@ elseif(APPLE)
\${TARGETDIR_VER}
)
- # copy scripts
- install_dir(
- ${CMAKE_SOURCE_DIR}/release/scripts
- \${TARGETDIR_VER}
- )
endif()
# install blenderplayer bundle - copy of blender.app above. re-using macros et al
# note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
if(WITH_GAMEENGINE AND WITH_PLAYER)
- set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
- set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
+ set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
+ set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
@@ -701,12 +685,12 @@ elseif(APPLE)
)
install(
- FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo
+ FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
)
install_dir(
- ${PLAYER_SOURCEDIR}/Contents/Resources
+ ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
\${TARGETDIR}/blenderplayer.app/Contents/
)
@@ -729,6 +713,11 @@ elseif(APPLE)
endif()
endif()
+# -----------------------------------------------------------------------------
+# Generic Install, for all targets
+
+
+
# install more files specified elsewhere
delayed_do_install(${TARGETDIR_VER})
diff --git a/source/creator/creator.c b/source/creator/creator.c
index bd1ab5dbc48..35076d6fe7e 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -439,7 +439,7 @@ static int prefsize(int argc, const char **argv, void *UNUSED(data))
int stax, stay, sizx, sizy;
if (argc < 5) {
- printf ("-p requires four arguments\n");
+ fprintf (stderr, "-p requires four arguments\n");
exit(1);
}
@@ -517,7 +517,7 @@ static int no_audio(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(da
static int set_audio(int argc, const char **argv, void *UNUSED(data))
{
if (argc < 1) {
- printf("-setaudio require one argument\n");
+ fprintf(stderr, "-setaudio require one argument\n");
exit(1);
}
@@ -979,6 +979,10 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
DAG_on_visible_update(CTX_data_main(C), TRUE);
}
+ else {
+ /* failed to load file, stop processing arguments */
+ return -1;
+ }
/* WM_read_file() runs normally but since we're in background mode do here */
#ifdef WITH_PYTHON
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index 682b42cc3cf..b1e3737af07 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -1362,14 +1362,17 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" )
int attr=0;
- if(!PyArg_ParseTuple(args, "i:setAttrib", &attr ))
+ if(!PyArg_ParseTuple(args, "i:setAttrib", &attr))
return NULL;
-
+
+ attr= SHD_TANGENT; /* user input is ignored for now, there is only 1 attr */
+
if(mShader==0) {
PyErr_SetString(PyExc_ValueError, "shader.setAttrib() BL_Shader, invalid shader object");
return NULL;
}
- mAttr=SHD_TANGENT; /* What the heck is going on here - attr is just ignored??? - Campbell */
+
+ mAttr= attr;
glUseProgramObjectARB(mShader);
glBindAttribLocationARB(mShader, mAttr, "Tangent");
Py_RETURN_NONE;
diff --git a/source/tests/pep8.py b/source/tests/pep8.py
index f7c416553b2..0c7c90a2382 100644
--- a/source/tests/pep8.py
+++ b/source/tests/pep8.py
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
import os
@@ -37,6 +37,7 @@ import os
# should be directly after the licence header, ~20 in most cases
PEP8_SEEK_COMMENT = 40
SKIP_PREFIX = "./tools", "./config", "./scons", "./extern"
+FORCE_PEP8_ALL = False
def file_list_py(path):
@@ -75,7 +76,7 @@ def main():
if [None for prefix in SKIP_PREFIX if f.startswith(prefix)]:
continue
- pep8_type = is_pep8(f)
+ pep8_type = FORCE_PEP8_ALL or is_pep8(f)
if pep8_type:
# so we can batch them for each tool.
@@ -112,7 +113,27 @@ def main():
print("\n\n\n# running pylint...")
for f, pep8_type in files:
# let pep8 complain about line length
- os.system("pylint --reports=n --max-line-length=1000 '%s'" % f)
+ os.system("pylint "
+ "--disable="
+ "C0111," # missing docstring
+ "C0103," # invalid name
+ "W0613," # unused argument, may add this back
+ # but happens a lot for 'context' for eg.
+ "W0232," # class has no __init__, Operator/Panel/Menu etc
+ "W0142," # Used * or ** magic
+ # even needed in some cases
+ "R0903," # bake_action] Too many statements (68/50)
+ "R0911," # Too many return statements
+ "R0912," # Too many branches
+ "R0913," # Too many arguments
+ "R0914," # Too many local variables
+ "R0915," # bake_action] Too many statements (68/50)
+ " "
+ "--include-ids=y "
+ "--output-format=parseable "
+ "--reports=n "
+ "--max-line-length=1000"
+ " '%s'" % f)
if __name__ == "__main__":
main()